FRIBParallelanalysis
1.0
FrameworkforMPIParalleldataanalysisatFRIB
|
#include <TCLObjectProcessor.h>
Public Member Functions | |
CTCLObjectProcessor (CTCLInterpreter &interp, std::string name, bool registerMe=true) | |
virtual | ~CTCLObjectProcessor () |
void | Register () |
Tcl_Command | RegisterAs (std::string name) |
void | unregister () |
void | unregisterAs (Tcl_Command token) |
std::string | getName () const |
Tcl_CmdInfo | getInfo () const |
![]() | |
CTCLInterpreterObject (CTCLInterpreter *pInterp) | |
CTCLInterpreterObject (const CTCLInterpreterObject &aCTCLInterpreterObject) | |
CTCLInterpreterObject & | operator= (const CTCLInterpreterObject &aCTCLInterpreterObject) |
int | operator== (const CTCLInterpreterObject &aCTCLInterpreterObject) const |
CTCLInterpreter * | getInterpreter () const |
CTCLInterpreter * | Bind (CTCLInterpreter &rBinding) |
CTCLInterpreter * | Bind (CTCLInterpreter *pBinding) |
Protected Member Functions | |
virtual int | operator() (CTCLInterpreter &interp, std::vector< CTCLObject > &objv)=0 |
virtual void | onUnregister () |
void | bindAll (CTCLInterpreter &interp, std::vector< CTCLObject > &objv) |
void | requireAtLeast (std::vector< CTCLObject > &objv, unsigned n, const char *msg=0) const |
void | requireAtMost (std::vector< CTCLObject > &objv, unsigned n, const char *msg=0) const |
void | requireExactly (std::vector< CTCLObject > &objv, unsigned n, const char *msg=0) const |
![]() | |
CTCLInterpreter * | AssertIfNotBound () |
This class encapsulates the Tcl_Obj command processor interface. we needed to start doing this because my understanding is that the argc/argv version of the interface is getting deprecated when Tcl/Tk 9.0 comes out. If you already have extensive command sets that use the argc/argv interface, fear not, as an adpator has been written to allow these to pretty much work once recompiled.
|
virtual |
Destruction just requires unregistering the command. The deletion callback will undoubtably be triggered.
|
protected |
bindAll Binds all the objects in a vector to an interpreter.
interp | - reference to the interpreter. |
objv | - reference to vector of objecgts. |
Tcl_CmdInfo CTCLObjectProcessor::getInfo | ( | ) | const |
Return information about this command from the Tcl interpreter.
copy | of struct from Tcl_GetCmdInfo(). |
CStateException | - If not registered. |
CTCLException | - If Tcl_GetCommandInfo fails. |
string CTCLObjectProcessor::getName | ( | ) | const |
Return the name of the command. If not registered, it's safe just to return m_Name, if registered, some script might have renamed us so we'll ask Tcl to tell us what our command name is.
|
protectedvirtual |
Called when the command is being unregistered. This is overridable, but not necessary. Our default action is to do nothing.
Reimplemented in CTCLCompatibilityProcessor, and ObjectEcho.
void CTCLObjectProcessor::Register | ( | ) |
Register this object as an object command. Note that if the command is already registered, we throw a CStateException.
CStateException | thrown if already registered. |
Tcl_Command CTCLObjectProcessor::RegisterAs | ( | std::string | name | ) |
Register the command with a specific name. This allows objects to field more than one command.
|
protected |
requireAtLeast Thrown std::string exception if the size of an objv is less than the specified number of parameters.
objv | - command object vector. |
n | - Minimmum size required of objv |
msg | - Pointer to the message string to use if the default is not desired. |
|
protected |
requireAtMost Same as requireAtLeast but there can be no more than n parameters.
objv | - command object vector. |
n | - Maximum size required of objv |
msg | - Pointer to the message string to use if the default is not desired. |
|
protected |
requireExactly Same as above but there must be exactly the requested number of params.
objv | - command object vector. |
n | - exact size required of objv |
msg | - Pointer to the message string to use if the default is not desired. |
void CTCLObjectProcessor::unregister | ( | ) |
Delete a command.
CStateException | - if the object is not deleted. |
CTCLException | - if the delete failed. |
void CTCLObjectProcessor::unregisterAs | ( | Tcl_Command | token | ) |
Unregister the command object from a specific command name
name | - THe name to unregister as. |