FRIBParallelanalysis  1.0
FrameworkforMPIParalleldataanalysisatFRIB
Public Member Functions | Protected Member Functions | List of all members
CTCLObjectProcessor Class Referenceabstract

#include <TCLObjectProcessor.h>

Inheritance diagram for CTCLObjectProcessor:
Inheritance graph
[legend]
Collaboration diagram for CTCLObjectProcessor:
Collaboration graph
[legend]

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
 
- Public Member Functions inherited from CTCLInterpreterObject
 CTCLInterpreterObject (CTCLInterpreter *pInterp)
 
 CTCLInterpreterObject (const CTCLInterpreterObject &aCTCLInterpreterObject)
 
CTCLInterpreterObjectoperator= (const CTCLInterpreterObject &aCTCLInterpreterObject)
 
int operator== (const CTCLInterpreterObject &aCTCLInterpreterObject) const
 
CTCLInterpretergetInterpreter () const
 
CTCLInterpreterBind (CTCLInterpreter &rBinding)
 
CTCLInterpreterBind (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
 
- Protected Member Functions inherited from CTCLInterpreterObject
CTCLInterpreterAssertIfNotBound ()
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ ~CTCLObjectProcessor()

CTCLObjectProcessor::~CTCLObjectProcessor ( )
virtual

Destruction just requires unregistering the command. The deletion callback will undoubtably be triggered.

Member Function Documentation

◆ bindAll()

void CTCLObjectProcessor::bindAll ( CTCLInterpreter interp,
std::vector< CTCLObject > &  objv 
)
protected

bindAll Binds all the objects in a vector to an interpreter.

Parameters
interp- reference to the interpreter.
objv- reference to vector of objecgts.

◆ getInfo()

Tcl_CmdInfo CTCLObjectProcessor::getInfo ( ) const

Return information about this command from the Tcl interpreter.

Returns
Tcl_CmdInfo
Return values
copyof struct from Tcl_GetCmdInfo().
Exceptions
CStateException- If not registered.
CTCLException- If Tcl_GetCommandInfo fails.

◆ getName()

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.

◆ onUnregister()

void CTCLObjectProcessor::onUnregister ( )
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.

◆ Register()

void CTCLObjectProcessor::Register ( )

Register this object as an object command. Note that if the command is already registered, we throw a CStateException.

Exceptions
CStateExceptionthrown if already registered.

◆ RegisterAs()

Tcl_Command CTCLObjectProcessor::RegisterAs ( std::string  name)

Register the command with a specific name. This allows objects to field more than one command.

◆ requireAtLeast()

void CTCLObjectProcessor::requireAtLeast ( std::vector< CTCLObject > &  objv,
unsigned  n,
const char *  msg = 0 
) const
protected

requireAtLeast Thrown std::string exception if the size of an objv is less than the specified number of parameters.

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.

◆ requireAtMost()

void CTCLObjectProcessor::requireAtMost ( std::vector< CTCLObject > &  objv,
unsigned  n,
const char *  msg = 0 
) const
protected

requireAtMost Same as requireAtLeast but there can be no more than n parameters.

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.

◆ requireExactly()

void CTCLObjectProcessor::requireExactly ( std::vector< CTCLObject > &  objv,
unsigned  n,
const char *  msg = 0 
) const
protected

requireExactly Same as above but there must be exactly the requested number of params.

Parameters
objv- command object vector.
n- exact size required of objv
msg- Pointer to the message string to use if the default is not desired.

◆ unregister()

void CTCLObjectProcessor::unregister ( )

Delete a command.

Exceptions
CStateException- if the object is not deleted.
CTCLException- if the delete failed.

◆ unregisterAs()

void CTCLObjectProcessor::unregisterAs ( Tcl_Command  token)

Unregister the command object from a specific command name

Parameters
name- THe name to unregister as.

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