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

CTclInterpreterShell Class Reference

#include <CTclInterpreterShell.h>

Inheritance diagram for CTclInterpreterShell:

CInterpreterShell List of all members.

Public Methods

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

Protected Methods

virtual CInterpreterCoreConstructCore ()

Private Methods

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

Private Attributes

CInterpreterCorem_pCore
 Pointer to core object.

bool m_bMyCore
 True if I had to allocate a core.


Constructor & Destructor Documentation

CTclInterpreterShell::CTclInterpreterShell  
 

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 CTclInterpreterShell.cpp.

CTclInterpreterShell::CTclInterpreterShell 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 CTclInterpreterShell.cpp.

CTclInterpreterShell::~CTclInterpreterShell  
 

Destructor:

Get rid of the interpreter core if it has been allocated by us:

Definition at line 341 of file CTclInterpreterShell.cpp.

References m_pCore.

CTclInterpreterShell::CTclInterpreterShell const CTclInterpreterShell &    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  - CTclInterpreterShell& rhs [in] - Template interpreter shell to copy into this.

Definition at line 360 of file CTclInterpreterShell.cpp.


Member Function Documentation

CInterpreterCore * CTclInterpreterShell::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 455 of file CTclInterpreterShell.cpp.

References getInterpreter().

Referenced by RegisterExtensions().

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

Implements CInterpreterShell.

Definition at line 332 of file CTclInterpreterShell.h.

Referenced by ConstructCore().

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

Definition at line 323 of file CTclInterpreterShell.h.

References operator==().

CTclInterpreterShell & CTclInterpreterShell::operator= const CTclInterpreterShell &    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 CTclInterpreterShell [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 379 of file CTclInterpreterShell.cpp.

References m_bMyCore, and m_pCore.

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

Equality comparison

Compares *this with rhs to determine equality. Equality is defined over CTclIntpreterShell 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 CTclIntepreterShell& [modified] The object to which *this will be compared.
Returns:
0 if not equal, 0==0 if equal.

Definition at line 404 of file CTclInterpreterShell.cpp.

References m_pCore.

Referenced by operator!=().

void CTclInterpreterShell::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 423 of file CTclInterpreterShell.cpp.

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


Member Data Documentation

bool CTclInterpreterShell::m_bMyCore [private]
 

True if I had to allocate a core.

Definition at line 311 of file CTclInterpreterShell.h.

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

CInterpreterCore* CTclInterpreterShell::m_pCore [private]
 

Pointer to core object.

Definition at line 310 of file CTclInterpreterShell.h.

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


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