HQP  1.9.6
If_Variable< VarType > Class Template Referenceabstract

Interface variable of abstract type VarType managing callbacks for reading and writing. More...

#include <If_Variable.h>

Inheritance diagram for If_Variable< VarType >:
[legend]

Public Member Functions

virtual ~If_Variable ()
 Destructor.
 
virtual VarType get () const
 Get value of interface variable.
 
virtual void set (VarType value)
 Set value of interface variable.
 
- Public Member Functions inherited from If_Element
 If_Element (const char *ifName)
 constructor
 
virtual ~If_Element ()
 destructor
 
const char * ifName ()
 get interface name
 
- Public Member Functions inherited from If_ListElement
 If_ListElement ()
 constructor
 
virtual ~If_ListElement ()
 destructor
 

Protected Member Functions

 If_Variable (const char *ifName, If_GetIf< VarType > *getCb, If_SetIf< VarType > *setCb=NULL)
 Constructor taking callback methods as arguments. More...
 
int invoke (Tcl_Interp *interp, int objc, Tcl_Obj *CONST objv[])
 Process command invokation.
 
virtual int getTclObj (Tcl_Interp *)=0
 Get the value of the interface variable and create a Tcl object containing it. More...
 
virtual int setTclObj (Tcl_Interp *, Tcl_Obj *CONST objPtr)=0
 Convert Tcl object to internal type and set the value of the interface variable. More...
 

Protected Attributes

If_GetIf< VarType > * _getCb
 callback for reading
 
If_SetIf< VarType > * _setCb
 callback for writing
 

Detailed Description

template<class VarType>
class If_Variable< VarType >

Interface variable of abstract type VarType managing callbacks for reading and writing.

A derived class should pass dynamically created callback objects to the constructor. In order to invoke the callbacks, the methods get and set should be called from within the implementations for getTclObj and setTclObj, respectively (as defined by If_VariableCmd). The destructor of this base class will delete the callback objects.

Constructor & Destructor Documentation

template<class VarType>
If_Variable< VarType >::If_Variable ( const char *  ifName,
If_GetIf< VarType > *  getCb,
If_SetIf< VarType > *  setCb = NULL 
)
inlineprotected

Constructor taking callback methods as arguments.

Member Function Documentation

template<class VarType>
virtual int If_Variable< VarType >::getTclObj ( Tcl_Interp *  )
protectedpure virtual

Get the value of the interface variable and create a Tcl object containing it.

Implemented in If_IntVec, If_RealMat, If_RealVec, If_StdString, If_Bool, If_Int, If_Real, and If_String.

Referenced by If_Variable< If_Real_t >::invoke().

template<class VarType>
virtual int If_Variable< VarType >::setTclObj ( Tcl_Interp *  ,
Tcl_Obj *CONST  objPtr 
)
protectedpure virtual

Convert Tcl object to internal type and set the value of the interface variable.

Implemented in If_IntVec, If_RealMat, If_RealVec, If_StdString, If_Bool, If_Int, If_Real, and If_String.

Referenced by If_Variable< If_Real_t >::invoke().


The documentation for this class was generated from the following file: