FRIBParallelanalysis
1.0
FrameworkforMPIParalleldataanalysisatFRIB
|
#include <TCLProcessor.h>
Public Member Functions | |
CTCLProcessor (const std::string sCommand, CTCLInterpreter *pInterp) | |
CTCLProcessor (const char *pCommand, CTCLInterpreter *pInterp) | |
virtual | ~CTCLProcessor () |
std::string | getCommandName () const |
virtual int | operator() (CTCLInterpreter &rInterpreter, CTCLResult &rResult, int argc, char **argv)=0 |
virtual void | OnDelete () |
void | Register () |
void | Unregister () |
void | RegisterAll () |
void | UnregisterAll () |
int | ParseInt (const char *pString, int *pInteger) |
int | ParseInt (const std::string &rString, int *pInteger) |
int | ParseDouble (const char *pString, double *pDouble) |
int | ParseDouble (const std::string &rString, double *pDouble) |
int | ParseBoolean (const char *pString, TCLPLUS::Bool_t *pBoolean) |
int | ParseBoolean (const std::string &rString, TCLPLUS::Bool_t *pBoolean) |
virtual void | preCommand () |
virtual void | postCommand () |
virtual void | preDelete () |
virtual void | postDelete () |
CTCLInterpreter * | Bind (CTCLInterpreter &binding) |
CTCLInterpreter * | Bind (CTCLInterpreter *binding) |
![]() | |
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) |
Static Public Member Functions | |
static std::string | ConcatenateParameters (int nArguments, char *pArguments[]) |
static int | MatchKeyword (std::vector< std::string > &MatchTable, const std::string &rValue, int NoMatch=-1) |
Protected Member Functions | |
void | NextParam (int &argc, char **&argv) |
![]() | |
CTCLInterpreter * | AssertIfNotBound () |
This class is an abstract base class for commands written against the argc/argv interface of Tcl/Tk. Note that since this interface is supposedly due to be deprecated with Tcl 9.0, this is actually written with the aid of an adaptor class (CTCLCompatibilityProcessor) to work with only the object interface.
This is a complete rewrite of this class since SpecTcl-3.0 however it should be compatible with older uses.
CTCLProcessor::CTCLProcessor | ( | const char * | pCommand, |
CTCLInterpreter * | pInterp | ||
) |
Construct from the char* version of the command name.
|
virtual |
Destruction requires unregistration, if possible, and deletion of the compatibility processor.
CTCLInterpreter * CTCLProcessor::Bind | ( | CTCLInterpreter * | binding | ) |
Binding must also rebind the adaptor.
|
static |
Concatenates a parameter set into a single string. This can be used by command interpreters which will need to further parse their input (e.g an epxression evaluator may want to act globally on the expression, rather than a token at a time). Spaces are put between each parameter.
nArguments | Number of parameters to concatenate. |
pArguments[] | : char* Pointer to the set of parameters to concatenate. |
String | containing the concatenation of the parameters. |
string CTCLProcessor::getCommandName | ( | ) | const |
Return the name of the command. This is the initial command name, not the name after any renaming e.g.
|
static |
Match a keyword, rValue, against the set of keywords in a MatchTable. If no match can be found, the NoMatch value is returned. Otherwise the index into the table is returned.
MatchTable | : vector<string>& vector of legitimate keyword strings. |
rValue | : const string& The keyword to match against the table. |
NoMatch | : int Value to return if no match is found. |
the | index into MatchTable where a string matched rValue. |
NoMatch | if there is no such index. |
|
virtual |
Called when the command is being deleted. The default action is to do nothing.
Reimplemented in Reverse.
int CTCLProcessor::ParseBoolean | ( | const char * | pString, |
TCLPLUS::Bool_t * | pBoolean | ||
) |
Parses a string as a boolean. True values are any of: 1,true,on, or yes False values are any of 0, false, off, or no.
pString | const char* Pointer to the string to parse. |
pBool | Bool_t* Pointer to the result boolean. |
TCL_OK | if parse worked. |
TCL_ERROR | and instantiating a CTCLResult object on the currently bound interpreter will enable a textual reason for the parse failure to be retrieved. |
int CTCLProcessor::ParseDouble | ( | const char * | pString, |
double * | pDouble | ||
) |
Parses a string as a double using the currently bound interpreter.
pString | char* String to parse. |
pDouble | double* Points to where to put value to parse. |
TCL_OK | - If ok. |
TCL_ERROR | and a CTCLResult can be instantiated on the bound interpreter to retrieve a textual reason for the parse failure. |
int CTCLProcessor::ParseInt | ( | const char * | pString, |
int * | pInteger | ||
) |
Uses the currently bound interpreter to parse a parameter as an integer.
\param pString : char* Pointer to the string to parse as an integer. \param pInteger : int* Pointer to the integer to fill in. \return int \retval TCL_OK if ok, \retval TCL_ERROR If not: client should instantiate a CTCLResult object on the bound interpreter to get detailed error information.
|
virtual |
This is a hook that can be overiddent by derived classes. It is called just after the execution of operator()... success or failure.
Reimplemented in Reverse.
|
virtual |
Hook for derived classes to get control just after OnDelete
|
virtual |
This is a hook that can be overridden by derived classes. It is called just prior to the execution of operator().
Reimplemented in Reverse.
|
virtual |
Hook for derived classes to get control just prior to OnDelete.
void CTCLProcessor::Register | ( | ) |
Register the object with the interpreter. We allow multiple registrations (subsequent are no-ops).
void CTCLProcessor::RegisterAll | ( | ) |
Register all is the same as register.
void CTCLProcessor::UnregisterAll | ( | ) |
Unregister all just does a caught unregister on the adaptor.