Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members   Related Pages  

CTkInterpreterShell Class Reference

#include <CTkInterpreterShell.h>

Inheritance diagram for CTkInterpreterShell:

CInterpreterShell List of all members.

Public Methods

 CTkInterpreterShell ()
 CTkInterpreterShell (CInterpreterCore &rCore)
 ~CTkInterpreterShell ()
virtual void RegisterExtensions ()
virtual CInterpreterStartup * getInterpreter ()

Protected Methods

virtual CInterpreterCoreConstructCore ()

Private Methods

 CTkInterpreterShell (const CTkInterpreterShell &rhs)
CTkInterpreterShell & operator= (const CTkInterpreterShell &rhs)
int operator== (const CTkInterpreterShell &rhs) const
int operator!= (const CTkInterpreterShell &rhs) const

Private Attributes

CInterpreterCorem_pCore
 Pointer to core object.

bool m_bMyCore
 True if I had to allocate a core.


Constructor & Destructor Documentation

CTkInterpreterShell::CTkInterpreterShell  
 

Default constructor

Constructs an interpreter shell when the core is not initially know or alternatively is not yet constructable. Action is as follows:

  • m_pCore <- 0
  • m_bMyCore <- false

Definition at line 312 of file CTkInterpreterShell.cpp.

CTkInterpreterShell::CTkInterpreterShell CInterpreterCore   rCore
 

Parameterized constructor:

Construtor to use if an interpreter core can be instantiated/constructed prior to the construction of an intperpreter shell (currently this may not be possible). Action is as follows:

  • m_pCore <- rCore
  • m_bMyCore <- false
Parameters:
rCore  - CInterpreterCore& [modified] Refers to the core extension package that will be used by this interpreter. Modified in the sense that at some later point, member functions of this core extension object will be called that can modify the object's state. It is the client's responsibility to manage rCore's allocation lifetime.

Definition at line 332 of file CTkInterpreterShell.cpp.

CTkInterpreterShell::~CTkInterpreterShell  
 

Destructor

Called when objects leave scope or when dynamically created objects are deleted. If the core extension 'belongs' to use we can delete it.

Definition at line 342 of file CTkInterpreterShell.cpp.

References m_pCore.

CTkInterpreterShell::CTkInterpreterShell const CTkInterpreterShell &    rhs [private]
 

Copy constructor

Does a shallow copy into this of a reference object. Note that copy construction is not reccomended as it complicates storage management. In no case does the m_bMyCore flag get set true in order to prevent deletion of the core used by the rhs.

Parameters:
rhs  - CTkInterpreterShell& rhs [in] - Template interpreter shell to copy into this.

Definition at line 362 of file CTkInterpreterShell.cpp.


Member Function Documentation

CInterpreterCore * CTkInterpreterShell::ConstructCore   [protected, virtual]
 

Create an interpreter core

This virtual, overridable function allows the shell to create an interpreter core extension package if none has been defined by the time RegisterExtensions() has been called. The default implementation creates and returns a pointer to a CInterpreterCore object. If a user wants to initialize additional extensions, they may extend CInterpreterCore and override this member function to instantiate their substitute interpreter core.

Returns:
A pointer to the newly created CInterpreterCore object, or a null pointer if the new built in failed.

Definition at line 456 of file CTkInterpreterShell.cpp.

References getInterpreter().

Referenced by RegisterExtensions().

virtual CInterpreterStartup* CTkInterpreterShell::getInterpreter   [inline, virtual]
 

Implements CInterpreterShell.

Definition at line 334 of file CTkInterpreterShell.h.

Referenced by ConstructCore().

int CTkInterpreterShell::operator!= const CTkInterpreterShell &    rhs const [inline, private]
 

Definition at line 325 of file CTkInterpreterShell.h.

References operator==().

CTkInterpreterShell & CTkInterpreterShell::operator= const CTkInterpreterShell &    rhs [private]
 

Assignment

Does a shallow copy into this from rhs. If m_bMyCore is true, the current core is deleted prior to doing the copy. In no case does the m_bMyCore wind up as true. Note that assignment is not reccomended, as it complicates storage management.

Parameters:
rhs  - const CTkInterpreterShell [modified] - Template to copy into this. Modification of the rhs.core may occur if at a later time non const members of that object are called.
Returns:
- Reference to *this so that operator chaining is supported.

Definition at line 381 of file CTkInterpreterShell.cpp.

References m_bMyCore, and m_pCore.

int CTkInterpreterShell::operator== const CTkInterpreterShell &    rhs const [private]
 

Equality comparison

Compares *this with rhs to determine equality. Equality is defined over CTkIntpreterShell such that if the core pointers are identical, the objects are equal. m_bMyCore is irrelevent since copy construction and assignment produce equivalent objects with m_bMyCore unconditionally false.

Parameters:
rhs  - const CTkIntepreterShell& [modified] The object to which *this will be compared.
Returns:
0 if not equal, 0==0 if equal.

Definition at line 406 of file CTkInterpreterShell.cpp.

References m_pCore.

Referenced by operator!=().

void CTkInterpreterShell::RegisterExtensions   [virtual]
 

Register core extensions.

If no core has been set, the virtual function ConstructCore is called to create an appropriate interpreter core, and m_bMyCore <- true. Once it is established that there is a valid core, its RegisterExtensions member is called to register the core command extensions on our interpreter.

Exceptions:
CErrnoException  & in the event ConstructCore() returns a null pointer (it is assumed that the reason for the failure to construct a valid exception is due to a condition that can be captured by errno).

Reimplemented from CInterpreterShell.

Definition at line 425 of file CTkInterpreterShell.cpp.

References ConstructCore(), CInterpreterShell::Initialize(), m_bMyCore, m_pCore, and CInterpreterCore::RegisterExtensions().


Member Data Documentation

bool CTkInterpreterShell::m_bMyCore [private]
 

True if I had to allocate a core.

Definition at line 313 of file CTkInterpreterShell.h.

Referenced by operator=(), and RegisterExtensions().

CInterpreterCore* CTkInterpreterShell::m_pCore [private]
 

Pointer to core object.

Definition at line 312 of file CTkInterpreterShell.h.

Referenced by operator=(), operator==(), RegisterExtensions(), and ~CTkInterpreterShell().


The documentation for this class was generated from the following files:
Generated on Fri Nov 8 13:37:27 2002 for Event Readout system. by doxygen1.2.16