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

CVariableBinding< T > Class Template Reference

#include <CVariableBinding.h>

Inheritance diagram for CVariableBinding< T >:

CBinding< T > CTypeFreeBinding List of all members.

Public Member Functions

 CVariableBinding (T &variable, const STD(string)&rName, T tInitialValue)
 CVariableBinding (T &variable, const char *pName, T tInitialValue)
 ~CVariableBinding ()
getVariable () const
 STD (string) getName() const
getInitValue () const
int getVarType () const
void setVariable (T value)
void setPointer (T *ptr)
void setName (const STD(string)&rName)
void setName (const char *pName)
void setInitialValue (T value)
void setVariableType (int type)
virtual void InitBindings (CTCLInterpreter &rInterp)
virtual void Commit (CTCLInterpreter &rInterp)
virtual void ShutdownBindings (CTCLInterpreter &rInterp)
virtual void Dump (int fd)

Private Member Functions

 STD (string) m_sName
 Name of the variable (for Tcl binding).
 CVariableBinding (const CVariableBinding &rBinding)
CVariableBindingoperator= (const CVariableBinding &rBinding)
int operator== (const CVariableBinding &rBinding)

Private Attributes

T * m_pVariable
 Pointer to the config variable.
m_tInitialValue
 Initial value of the variable.
int m_TCLVariableType
 Type of binding (for TCL).

Detailed Description

template<class T>
class CVariableBinding< T >

CVariableBinding is a class which encapsulates a configuration scalar variable. The Variable is maintained by the user of this class. The InitBindings makes a link to the variable. The Commit does nothing The ShutdownBindings member removes the link.

Definition at line 318 of file CVariableBinding.h.


Constructor & Destructor Documentation

template<class T>
CVariableBinding< T >::CVariableBinding T &  variable,
const STD(string)&  rName,
tInitialValue
 

template<class T>
CVariableBinding< T >::CVariableBinding T &  variable,
const char *  pName,
tInitialValue
 

Construct a variable binding from the variable reference asciz string pointer and initial value:

Parameters:
variable - Reference to the variable to configure.
pName - Reference to char* string to give name.
tInitialValue - Initial value to give to the variable.

Definition at line 331 of file CVariableBinding.cpp.

template<class T>
CVariableBinding< T >::~CVariableBinding  )  [inline]
 

Definition at line 328 of file CVariableBinding.h.

template<class T>
CVariableBinding< T >::CVariableBinding const CVariableBinding< T > &  rBinding  )  [private]
 


Member Function Documentation

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

Commit - no commit operation is required. Since the variable was linked, it already has any changed value.

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

Implements CBinding< T >.

Definition at line 363 of file CVariableBinding.cpp.

template<class T>
void CVariableBinding< T >::Dump int  fd  )  [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 CBinding< T >.

Definition at line 392 of file CVariableBinding.cpp.

References CVariableBinding< T >::m_pVariable.

template<class T>
T CVariableBinding< T >::getInitValue  )  const [inline]
 

Definition at line 344 of file CVariableBinding.h.

template<class T>
T CVariableBinding< T >::getVariable  )  const [inline]
 

Definition at line 338 of file CVariableBinding.h.

template<class T>
int CVariableBinding< T >::getVarType  )  const [inline]
 

Definition at line 347 of file CVariableBinding.h.

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

Initialize bindings prior to reading the configuration file. In this case, the TCL variable is bound to the thing referenced by the m_pVariable pointer.

Parameters:
rInterp - The interpreter which will be used to read the config file.

Implements CBinding< T >.

Definition at line 347 of file CVariableBinding.cpp.

References CVariableBinding< T >::m_pVariable.

template<class T>
CVariableBinding& CVariableBinding< T >::operator= const CVariableBinding< T > &  rBinding  )  [private]
 

template<class T>
int CVariableBinding< T >::operator== const CVariableBinding< T > &  rBinding  )  [private]
 

template<class T>
void CVariableBinding< T >::setInitialValue value  )  [inline]
 

Definition at line 364 of file CVariableBinding.h.

References CVariableBinding< T >::m_tInitialValue.

template<class T>
void CVariableBinding< T >::setName const char *  pName  )  [inline]
 

Definition at line 361 of file CVariableBinding.h.

References CVariableBinding< T >::STD().

template<class T>
void CVariableBinding< T >::setName const STD(string)&  rName  )  [inline]
 

Definition at line 358 of file CVariableBinding.h.

template<class T>
void CVariableBinding< T >::setPointer T *  ptr  )  [inline]
 

Definition at line 355 of file CVariableBinding.h.

References CVariableBinding< T >::m_pVariable.

template<class T>
void CVariableBinding< T >::setVariable value  )  [inline]
 

Definition at line 352 of file CVariableBinding.h.

References CVariableBinding< T >::m_pVariable.

template<class T>
void CVariableBinding< T >::setVariableType int  type  )  [inline]
 

Definition at line 367 of file CVariableBinding.h.

References CVariableBinding< T >::m_TCLVariableType.

template<class T>
void CVariableBinding< T >::ShutdownBindings CTCLInterpreter &  rInterp  )  [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 CBinding< T >.

Definition at line 372 of file CVariableBinding.cpp.

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

Definition at line 341 of file CVariableBinding.h.

template<class T>
CVariableBinding< T >::STD string   )  [private]
 

Name of the variable (for Tcl binding).

Reimplemented from CBinding< T >.

Referenced by CVariableBinding< T >::setName().


Member Data Documentation

template<class T>
T* CVariableBinding< T >::m_pVariable [private]
 

Pointer to the config variable.

Definition at line 320 of file CVariableBinding.h.

Referenced by CVariableBinding< T >::Dump(), CVariableBinding< T >::InitBindings(), CVariableBinding< T >::setPointer(), and CVariableBinding< T >::setVariable().

template<class T>
int CVariableBinding< T >::m_TCLVariableType [private]
 

Type of binding (for TCL).

Definition at line 323 of file CVariableBinding.h.

Referenced by CVariableBinding< T >::setVariableType().

template<class T>
T CVariableBinding< T >::m_tInitialValue [private]
 

Initial value of the variable.

Definition at line 322 of file CVariableBinding.h.

Referenced by CVariableBinding< T >::setInitialValue().


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