|
NSCL DDAS 12.2-009
Support for XIA DDAS at FRIB
|
#include <CTclCommand.h>

Public Member Functions | |
| CTclCommand (Tcl_Interp *pInterp, const char *cmdName) | |
| virtual | ~CTclCommand () |
| virtual int | operator() (std::vector< Tcl_Obj * > &argv)=0 |
Protected Member Functions | |
| Tcl_Interp * | getInterpreter () |
| void | requireExactly (std::vector< Tcl_Obj * > &objv, int nParams) |
| void | requireAtMost (std::vector< Tcl_Obj * > &objv, int max) |
| void | setResult (const char *result) |
| void | setResult (Tcl_Obj *result) |
| void | setResult (double value) |
| void | setResult (int value) |
| int | getInteger (Tcl_Obj *intObj) |
| double | getDouble (Tcl_Obj *dblObj) |
This class is a light weight replacement for CTCLObjectCommand. in this project we don't have the libtcl++ library available but this makes object oriented command handlers somewhat simpler.
| CTclCommand::CTclCommand | ( | Tcl_Interp * | pInterp, |
| const char * | cmdName | ||
| ) |
constructor
| pInterp | Interpreter on which the command is registered. |
| cmdName | Command name string. |
|
virtual |
destructor unregisters the command
|
protected |
getDouble Get a double value from an object.
| dblObj | - the object. |
| std::string | if the object does not have double rep. |
|
protected |
getInteger Get an integer value from an object.
| obj | the object. |
| std::string | if the object does not have a valid integer. |
|
inlineprotected |
|
pure virtual |
Implemented in CInitSystem, CInventory, CBoot, CAdjustOffsets, CIsActive, CReadChanPar, CReadModPar, CRelease, CRestoreParams, CSaveParams, CWriteChanPar, and CWriteModPar.
|
protected |
requireAtMost Require at most a specified number of command words.
| objv | - the command words. |
| max | - maximum number of words allowed. |
| std::string | error message if there are too many params. |
|
protected |
requireExactly Require an exact parameter count.
| objv | - the parameter vector. |
| nParams | - number required. |
| std::string | error message if there's not a match. |
|
protected |
setResult (String) Given a string, sets the Tcl intepreter result to it.
| result | the string |
|
protected |
setREsult (double)
|
protected |
|
protected |
setResult (Tcl_Obj*)