#include <CArrayBinding.h>
Inheritance diagram for CArrayBinding< T >:
Public Member Functions | |
CArrayBinding (T *pArray, int nFirst, int nLast, const STD(string)&m_sName, T *Defaults=NULL) | |
CArrayBinding (T *pArray, int nFirst, int nLast, const char *m_sName, T *Defaults=NULL) | |
~CArrayBinding () | |
T | getValue (int n) const |
T * | getPointer () |
int | getFirstIndex () const |
int | getLastIndex () const |
STD (string) getArrayName() const | |
T | getDefault (int n) const |
int | getVariableType () const |
virtual void | InitBindings (CTCLInterpreter &rInterp) |
virtual void | Commit (CTCLInterpreter &rInterp) |
virtual void | ShutdownBindings (CTCLInterpreter &rInterp) |
virtual void | Dump (int fd) |
Protected Member Functions | |
void | setValue (int n, T value) |
void | setArrayBase (T *pBase) |
void | setFirstIndex (int n) |
void | setLastIndex (int n) |
void | setName (const STD(string)&rName) |
void | setDefaults (T *pDefaults) |
void | setVariableType (int nType) |
Private Member Functions | |
STD (string) m_sName | |
Name of the Tcl array. | |
CArrayBinding (const CArrayBinding &rhs) | |
Forbidden. | |
CArrayBinding & | operator= (const CArrayBinding &rhs) |
Forbidden. | |
int | operator== (const CArrayBinding &rhs) |
Forbidden. | |
Private Attributes | |
T * | m_pArrayBase |
Pointer to the configured array. | |
int | m_nFirstIndex |
Low index of the binding. | |
int | m_nLastIndex |
High index of the binding. | |
T * | m_pInitialValues |
Optional array of initial values. | |
int | m_TCLVariableType |
Type of the variable. |
Definition at line 335 of file CArrayBinding.h.
|
|
|
Construct an array binding from a TCL Variable name given as a char*:
Definition at line 331 of file CArrayBinding.cpp. |
|
Definition at line 353 of file CArrayBinding.h. |
|
Forbidden.
|
|
Commits the changes from the TCL array to the configured array. This is done by sequentially attempting to read the TCL array with textual indices that are encoded integers in the range [m_nFirstIndex, m_nLastIndex). For each succesful read of a variable and decode of an integer value from it, the corresponding configured array element is set. Note that strings (T == char* are handled specially.
Implements CBinding< T >. Definition at line 371 of file CArrayBinding.cpp. References CArrayBinding< T >::m_pArrayBase. |
|
Dumps the contents of the array to a file in TCL Script form. Since spaces are possible, this cannot be done straightforwardly. We will build (for each line in the file): a list containing the set command, the variable, and index name, and the stringified array value.
Implements CBinding< T >. Definition at line 444 of file CArrayBinding.cpp. References CArrayBinding< T >::m_pArrayBase. |
|
Definition at line 378 of file CArrayBinding.h. |
|
Definition at line 369 of file CArrayBinding.h. |
|
Definition at line 372 of file CArrayBinding.h. |
|
Definition at line 366 of file CArrayBinding.h. |
|
Definition at line 363 of file CArrayBinding.h. References CArrayBinding< T >::m_pArrayBase. |
|
Definition at line 386 of file CArrayBinding.h. |
|
Initializes the objects prior to reading in the configuration file. For arrays, what we do is just initialize the configured array slice.
Implements CBinding< T >. Definition at line 351 of file CArrayBinding.cpp. References CArrayBinding< T >::m_pArrayBase, and CArrayBinding< T >::m_pInitialValues. |
|
Forbidden.
|
|
Forbidden.
|
|
Definition at line 395 of file CArrayBinding.h. References CArrayBinding< T >::m_pArrayBase. |
|
Definition at line 407 of file CArrayBinding.h. References CArrayBinding< T >::m_pInitialValues. |
|
Definition at line 398 of file CArrayBinding.h. References CArrayBinding< T >::m_nFirstIndex. |
|
Definition at line 401 of file CArrayBinding.h. References CArrayBinding< T >::m_nLastIndex. |
|
Definition at line 404 of file CArrayBinding.h. |
|
Definition at line 392 of file CArrayBinding.h. References CArrayBinding< T >::m_pArrayBase. |
|
Definition at line 410 of file CArrayBinding.h. References CArrayBinding< T >::m_TCLVariableType. |
|
Terminates any linkages to the Tcl variable space.. this is a no-op for this class.
Implements CBinding< T >. Definition at line 428 of file CArrayBinding.cpp. |
|
Definition at line 375 of file CArrayBinding.h. |
|
Name of the Tcl array.
Reimplemented from CBinding< T >. |
|
Low index of the binding.
Definition at line 340 of file CArrayBinding.h. Referenced by CArrayBinding< T >::setFirstIndex(). |
|
High index of the binding.
Definition at line 341 of file CArrayBinding.h. Referenced by CArrayBinding< T >::setLastIndex(). |
|
Pointer to the configured array.
Definition at line 339 of file CArrayBinding.h. Referenced by CArrayBinding< T >::Commit(), CArrayBinding< T >::Dump(), CArrayBinding< T >::getValue(), CArrayBinding< T >::InitBindings(), CArrayBinding< T >::setArrayBase(), and CArrayBinding< T >::setValue(). |
|
Optional array of initial values.
Definition at line 343 of file CArrayBinding.h. Referenced by CArrayBinding< T >::InitBindings(), and CArrayBinding< T >::setDefaults(). |
|
Type of the variable.
Definition at line 344 of file CArrayBinding.h. Referenced by CArrayBinding< T >::setVariableType(). |