Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members | Related Pages

CInterpreterStartup Class Reference

#include <CInterpreterStartup.h>

Inheritance diagram for CInterpreterStartup:

CEventLoop CTCLInterpreterStartup CTKInterpreterStartup List of all members.

Public Member Functions

 CInterpreterStartup ()
 Nulls out the interpreter and sync command pointers.
virtual ~CInterpreterStartup ()
CTCLInterpreter * getInterpreter ()
 Return a pointer to the interpreter object.
CTCLInterpreter & Interp ()

Protected Member Functions

virtual void OnInitialize (int argc, char **Argv)
virtual void RegisterExtensions ()
void setInterpreter (CTCLInterpreter *pInterp)
 Set the interpreter object:.

Private Member Functions

int operator() (int argc, char **argv)=0
 CInterpreterStartup (const CInterpreterStartup &aCInterpreterStartup)
 Copy Constructor is forbidden, private, unimplemented.
CInterpreterStartupoperator= (const CInterpreterStartup &aCInterpreterStartup)
 Assignment is forbidden, private, unimplemented.
int operator== (const CInterpreterStartup &aCInterpreterStartup) const
 Operator== Equality Operator forbidden, private, unimplemented.

Private Attributes

CTCLInterpreter * m_pInterp
CTCLSynchronizeCommandm_pSyncCommand

Detailed Description

Encapsulates interfaces for starting up TCL based interpreter event loops. The TCL interpreter executes within a thread. Adding a command to the interpreter should be done by subclassing CDAQTCLProcessor, instantiating an object for that class, and registring it on the current interpreter. It is important that DAQTCLProcessor objects be used rather than TCLProcessor objects since DAQTCLProcessor is thread-aware and will therefore synchronize its action through the application's global mutex.

Definition at line 315 of file CInterpreterStartup.h.


Constructor & Destructor Documentation

CInterpreterStartup::CInterpreterStartup  ) 
 

Nulls out the interpreter and sync command pointers.

Encapsulates interfaces for starting up TCL based interpreter event loops. The TCL interpreter executes within a thread. Adding a command to the interpreter should be done by subclassing CDAQTCLProcessor, instantiating an object for that class, and registring it on the current interpreter. It is important that DAQTCLProcessor objects be used rather than TCLProcessor objects since DAQTCLProcessor is thread-aware and will therefore synchronize its action through the application's global mutex.

Definition at line 305 of file CInterpreterStartup.cpp.

CInterpreterStartup::~CInterpreterStartup  )  [virtual]
 

The destructor only destroys the sync command. The subclass is responsible for destroying the interpreter which in turn will unregister the sync command

Definition at line 316 of file CInterpreterStartup.cpp.

CInterpreterStartup::CInterpreterStartup const CInterpreterStartup aCInterpreterStartup  )  [private]
 

Copy Constructor is forbidden, private, unimplemented.


Member Function Documentation

CTCLInterpreter* CInterpreterStartup::getInterpreter  )  [inline]
 

Return a pointer to the interpreter object.

Definition at line 353 of file CInterpreterStartup.h.

CTCLInterpreter & CInterpreterStartup::Interp  ) 
 

Get a reference to the interpreter object: Note that this can fail if there is not yet an interpreter (m_pInterp is NULL in that case).

Definition at line 367 of file CInterpreterStartup.cpp.

void CInterpreterStartup::OnInitialize int  argc,
char **  Argv
[protected, virtual]
 

On initialize is called very early in the execution of the operator() member. It is intended that subclassed interpreters perform early initialization here. At this point an interpreter has not yet been instantiated. Therefore, you may not perform Tcl/Tk library calls at this stage.

Default implementation is a no-op.

Definition at line 337 of file CInterpreterStartup.cpp.

Referenced by CTKInterpreterStartup::operator()(), and CTCLInterpreterStartup::operator()().

int CInterpreterStartup::operator() int  argc,
char **  argv
[private, pure virtual]
 

This pure virtual member function is expected to start the interpreter and call the other member functions; it is the entry point of the thread.

Implements CEventLoop.

Implemented in CTCLInterpreterStartup, and CTKInterpreterStartup.

CInterpreterStartup& CInterpreterStartup::operator= const CInterpreterStartup aCInterpreterStartup  )  [private]
 

Assignment is forbidden, private, unimplemented.

int CInterpreterStartup::operator== const CInterpreterStartup aCInterpreterStartup  )  const [private]
 

Operator== Equality Operator forbidden, private, unimplemented.

void CInterpreterStartup::RegisterExtensions  )  [protected, virtual]
 

Concrete subclasses of this class must implement this function. It is expected that all tcl interpreters run in this envrionment will have extensions At this point, an interpreter has been created.

If this is a Tk derived interpreter, it's not certain that the tk Main window has been created yet however.

Default behavior which should be chained to by subclasses is to register the synch command. This makes available scripts which are synchronized to the application's global mutex.

Definition at line 360 of file CInterpreterStartup.cpp.

References m_pInterp, m_pSyncCommand, and CDAQTCLProcessor::Register().

Referenced by CTCLInterpreterStartup::Tcl_Init(), and CTKInterpreterStartup::Tk_Init().

void CInterpreterStartup::setInterpreter CTCLInterpreter *  pInterp  )  [inline, protected]
 

Set the interpreter object:.

Definition at line 366 of file CInterpreterStartup.h.

References m_pInterp.

Referenced by CTCLInterpreterStartup::Tcl_Init(), and CTKInterpreterStartup::Tk_Init().


Member Data Documentation

CTCLInterpreter* CInterpreterStartup::m_pInterp [private]
 

Definition at line 318 of file CInterpreterStartup.h.

Referenced by RegisterExtensions(), and setInterpreter().

CTCLSynchronizeCommand* CInterpreterStartup::m_pSyncCommand [private]
 

Definition at line 319 of file CInterpreterStartup.h.

Referenced by RegisterExtensions().


The documentation for this class was generated from the following files:
Generated on Thu Jan 6 16:58:44 2005 for Spectrodaq External Event Framework by  doxygen 1.3.9.1