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

CBinding< T > Class Template Reference

#include <CBinding.h>

Inheritance diagram for CBinding< T >:

CTypeFreeBinding CArrayBinding< T > CAssocArrayBinding< T > CVariableBinding< T > List of all members.

Public Member Functions

virtual void InitBindings (CTCLInterpreter &rInterp)=0
virtual void Commit (CTCLInterpreter &rInterp)=0
virtual void ShutdownBindings (CTCLInterpreter &rInterp)=0
virtual void Dump (int fd)=0
int VariableType (T item)
 STD (string) ItemToString(T Item)

Detailed Description

template<class T>
class CBinding< T >

This is an abstract base class for the Tcl configuration manager's bindings subsystem. interfaces for the functions required of all bindings objects are defined as pure virtual member functions.

Definition at line 322 of file CBinding.h.


Member Function Documentation

template<class T>
virtual void CBinding< T >::Commit CTCLInterpreter &  rInterp  )  [pure virtual]
 

This function is called just after a configuration script or set of configuration scripts have been read to perform any actions required to commit the read in Tcl values to the variables. For example, an associative array bindings might need to fetch the individual values from Tcl array elements.

Parameters:
rInterp - The interpreter in which the config script was read.

Implements CTypeFreeBinding.

Implemented in CArrayBinding< T >, CAssocArrayBinding< T >, and CVariableBinding< T >.

template<class T>
virtual void CBinding< T >::Dump int  fd  )  [pure virtual]
 

This function is called to write the set of Tcl commands required to duplicate the current state. Note that this may not be identical to the set of commands which produced the configuration.

Parameters:
fd (int [in]) The file descriptor on which the dump will be done.

Implements CTypeFreeBinding.

Implemented in CArrayBinding< T >, CAssocArrayBinding< T >, and CVariableBinding< T >.

template<class T>
virtual void CBinding< T >::InitBindings CTCLInterpreter &  rInterp  )  [pure virtual]
 

This function will be called just prior to reading in a configuration file. The Tcl Interpreter has been set up and initialized. The Init function can do any preparation required by the binding prior to readin (e.g. a simple binding >might< bind the contained variable to a Tcl variable

Parameters:
rInterp - The interpreter on which the config script will be read.

Implements CTypeFreeBinding.

Implemented in CArrayBinding< T >, CAssocArrayBinding< T >, and CVariableBinding< T >.

template<class T>
virtual void CBinding< T >::ShutdownBindings CTCLInterpreter &  rInterp  )  [pure virtual]
 

This function is called just prior to deleting the interpreter. Any cleanup actions required by the binding should be done at this point. For example, if Init mapped a C variable to a TCL variable, that mapping should be broken.

Parameters:
rInterp - The interpreter about to be deleted.

Implements CTypeFreeBinding.

Implemented in CArrayBinding< T >, CAssocArrayBinding< T >, and CVariableBinding< T >.

template<class T>
CBinding< T >::STD string   )  [inline]
 

Item to string conversion: Converts an item of type T to its string representation.

Parameters:
Item - item to convert.
Exceptions:
CRangeError - no type match
Bug:
Should invent a bad type exception and throw it.

Reimplemented in CArrayBinding< T >, CAssocArrayBinding< T >, and CVariableBinding< T >.

Definition at line 392 of file CBinding.h.

template<class T>
int CBinding< T >::VariableType item  )  [inline]
 

Returns the TCL code for the type of variable being bound to: This can be one of:

  • TCL_LINK_INT - Variable is an integer.
  • TCL_LINK_DOUBLE - Variable is a double precision.
  • TCL_LINK_BOOLEAN - Variable is a boolean.
  • TCL_LINK_STRING - Variable is a char*.

Parameters:
item - A variable of type T.
Exceptions:
CRangeError - no neat match.

Bug:
Really should invent a bad type exception and throw it instead

Definition at line 374 of file CBinding.h.

Referenced by CAssocArrayBinding< T >::CAssocArrayBinding().


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