#include <CConfigurableObject.h>
Inheritance diagram for CConfigurableObject:
Public Types | |
typedef list< CConfigurationParameter * > | ConfigArray |
typedef ConfigArray::iterator | ParameterIterator |
typedef list< CConfigurationParameter * > | ConfigArray |
typedef ConfigArray::iterator | ParameterIterator |
Public Member Functions | |
CConfigurableObject (const string &rName, CTCLInterpreter &rInterp) | |
virtual | ~CConfigurableObject () |
string | getName () const |
Retrieve a copy of the name:. | |
virtual int | operator() (CTCLInterpreter &rInterp, CTCLResult &rResult, int nArgs, char **pArgs) |
Process commands. | |
virtual int | Configure (CTCLInterpreter &rInterp, CTCLResult &rResult, int nArgs, char **pArgs) |
config subcommand | |
virtual int | ListConfiguration (CTCLInterpreter &rInterp, CTCLResult &rResult, int nArgs, char **pArgs) |
list subcommand | |
ParameterIterator | AddIntParam (const string &sParamName, int nDefault=0) |
Create an int. | |
ParameterIterator | AddBoolParam (const string &rName, bool fDefault) |
Create a boolean. | |
ParameterIterator | AddStringParam (const string &rName) |
Create string param. | |
ParameterIterator | AddIntArrayParam (const string &rParameterName, int nArraySize, int nDefault=0) |
Create array of ints. | |
ParameterIterator | AddStringArrayParam (const string &rName, int nArraySize) |
Create array of strings. | |
ParameterIterator | Find (const string &rKeyword) |
Find a param. | |
ParameterIterator | begin () |
Config param start iterator. | |
ParameterIterator | end () |
Config param end iterator. | |
int | size () |
Config param number of items. | |
string | ListParameters (const string &rPattern) |
List configuration. | |
string | ListKeywords () |
List keyword/type pairs. | |
CConfigurableObject (const string &rName, CTCLInterpreter &rInterp) | |
virtual | ~CConfigurableObject () |
virtual int | operator() (CTCLInterpreter &rInterp, CTCLResult &rResult, int nArgs, char **pArgs) |
Process commands. | |
int | Configure (CTCLInterpreter &rInterp, CTCLResult &rResult, int nArgs, char **pArgs) |
config subcommand | |
int | ListConfiguration (CTCLInterpreter &rInterp, CTCLResult &rResult, int nArgs, char **pArgs) |
list subcommand | |
ParameterIterator | AddIntParam (const string &sParamName, int nDefault=0) |
Create an int. | |
ParameterIterator | AddBoolParam () |
Create a boolean. | |
ParameterIterator | AddStringParam (const string &rName) |
Create string param. | |
ParameterIterator | AddIntArrayParam (const string &rParameterName, int nArraySize, int nDefault=0) |
Create array of ints. | |
ParameterIterator | AddStringArrayParam (const string &rName, int nArraySize) |
Create array of strings. | |
void | DeleteParameters () |
Delete all parameters. | |
ParameterIterator | Find (const string &rKeyword) |
Find a param. | |
ParameterIterator | begin () |
Config param start iterator. | |
ParameterIterator | end () |
Config param end iterator. | |
int | size () |
Config param number of items. | |
string | ListParameters (CTCLInterpreter &rInterp, const string &rPattern) |
List configuration. | |
string | ListKeywords () |
List keyword/type pairs. | |
virtual bool | isMySubcommand (const string &rKeyword) |
Valid subcomand? | |
Protected Member Functions | |
string | Usage () |
Private Member Functions | |
CConfigurableObject (const CConfigurableObject &aCConfigurableObject) | |
CConfigurableObject & | operator= (const CConfigurableObject &aCConfigurableObject) |
int | operator== (const CConfigurableObject &aCConfigurableObject) const |
void | DeleteParameters () |
Delete all parameters. | |
CConfigurableObject (const CConfigurableObject &aCConfigurableObject) | |
CConfigurableObject & | operator= (const CConfigurableObject &aCConfigurableObject) |
int | operator== (const CConfigurableObject &aCConfigurableObject) const |
Private Attributes | |
string | m_sName |
Name of the command associated with the object. | |
ConfigArray | m_Configuration |
The configuration. |
Each of these represents a keyword/value pair.
Definition at line 336 of file CConfigurableObject.h.
|
Reimplemented in CDigitizerModule. Definition at line 339 of file include/CConfigurableObject.h. |
|
Reimplemented in CDigitizerModule. Definition at line 340 of file CConfigurableObject.h. |
|
Reimplemented in CDigitizerModule. Definition at line 340 of file include/CConfigurableObject.h. |
|
Reimplemented in CDigitizerModule. Definition at line 341 of file CConfigurableObject.h. Referenced by Configure(), CReadOrder::CReadOrder(), DeleteParameters(), Find(), ListKeywords(), and ListParameters(). |
|
Construct a Configurable object:
Definition at line 303 of file CConfigurableObject.cpp. |
|
Destructor: The configuration parmaters pointed to by the elements of the list are assumed to be dynamically allocated (as they will be if they are created with our convenience functions. They must be deleted. The list elements themselves are assumed to be destroyed by the list destructors. Definition at line 320 of file CConfigurableObject.cpp. References DeleteParameters(). |
|
|
|
|
|
|
|
|
|
Create a boolean.
Referenced by CCAENModule::CCAENModule(), CCAENV775::CCAENV775(), CCAENV830Module::CCAENV830Module(), and CReadOrder::CReadOrder(). |
|
Create a boolean. Function: Adds a boolean parameter to the set of parameters that are recognized by the default Configure parser.
Reimplemented in CDigitizerModule. Definition at line 587 of file CConfigurableObject.cpp. References Find(), and m_Configuration. |
|
Create array of ints.
Reimplemented in CDigitizerModule. |
|
Create array of ints. Adds an array of parameters to the set of configuration parameter that are parsed by the default Configure function.
Reimplemented in CDigitizerModule. Definition at line 563 of file CConfigurableObject.cpp. References Find(), and m_Configuration. |
|
Create an int.
Reimplemented in CDigitizerModule. |
|
Create an int. Adds an integer configuration parameter to the set recognized by the default configuration parser.
Reimplemented in CDigitizerModule. Definition at line 540 of file CConfigurableObject.cpp. References Find(), and m_Configuration. Referenced by CReadOrder::CReadOrder(). |
|
Create array of strings.
Reimplemented in CDigitizerModule. |
|
Create array of strings. Adds a string array parameter to the set of parameters recognized by this module. A string array parameter has a parameter that is a tcl formatted list where each list element is an arbitrary string.
Reimplemented in CDigitizerModule. Definition at line 625 of file CConfigurableObject.cpp. References Find(), and m_Configuration. |
|
Create string param.
Reimplemented in CDigitizerModule. |
|
Create string param. Adds a string parameter to the set of parameters recognized by this module. A string parameter is a parameter with a single string valued value.
Reimplemented in CDigitizerModule. Definition at line 606 of file CConfigurableObject.cpp. References Find(), and m_Configuration. |
|
Config param start iterator.
Reimplemented in CDigitizerModule, and CReadOrder. |
|
Config param start iterator.
Reimplemented in CDigitizerModule, and CReadOrder. Definition at line 680 of file CConfigurableObject.cpp. References m_Configuration. Referenced by DeleteParameters(). |
|
config subcommand
Reimplemented in CDigitizerModule. |
|
config subcommand Function: int Configure(CTCLInterpreter& rInterp, CTCLResult& rResult, int nArgs, char** pArgs) Operation Type: Purpose: Handles the "configure" command. The default implementation is to assume configuration is a set of keyword value pairs. e.g:
Each keyword is matched against the parameters in the following order. Naturally duplicate command keys are not a good thing.
See CConfigurationParameter CIntConfigParam CIntArrayParam CBoolConfigParam As many configuration options as can be performed get done. Any failures are reported by returning TCL_ERROR and placing stuff in the results string.
Reimplemented in CDigitizerModule. Definition at line 435 of file CConfigurableObject.cpp. References Find(), m_Configuration, ParameterIterator, and Usage(). Referenced by CPacketCreator::Create(), CCAENV830Creator::Create(), CCAENV785Creator::Create(), and operator()(). |
|
Delete all parameters.
Reimplemented in CDigitizerModule. |
|
Delete all parameters. Delete the parameter arrays. Reimplemented in CDigitizerModule. Definition at line 784 of file CConfigurableObject.cpp. References begin(), end(), m_Configuration, and ParameterIterator. Referenced by ~CConfigurableObject(). |
|
Config param end iterator.
Reimplemented in CDigitizerModule, and CReadOrder. |
|
Config param end iterator.
Reimplemented in CDigitizerModule, and CReadOrder. Definition at line 691 of file CConfigurableObject.cpp. References m_Configuration. Referenced by DeleteParameters(). |
|
Find a param.
Reimplemented in CDigitizerModule. |
|
Find a param. Locate a parameter matching the configuration parameter test string.
Reimplemented in CDigitizerModule. Definition at line 764 of file CConfigurableObject.cpp. References m_Configuration, CConfigurationParameter::Match(), and ParameterIterator. Referenced by AddBoolParam(), AddIntArrayParam(), AddIntParam(), AddStringArrayParam(), AddStringParam(), and Configure(). |
|
Retrieve a copy of the name:.
Reimplemented in CDigitizerModule. Definition at line 366 of file CConfigurableObject.h. References m_sName. Referenced by CDigitizerDictionary::DigitizerAdd(), CReadOrder::Lister::operator()(), and CReadOrder::CompareName::operator()(). |
|
Valid subcomand?
|
|
list subcommand
Reimplemented in CDigitizerModule. |
|
list subcommand Lists the current module configuration. The default implementation iterates through the set of m_IntParameters, m_ArrayParameters and m_BoolParameters producing pairs of {parametername values} such as:
Reimplemented in CDigitizerModule. Definition at line 508 of file CConfigurableObject.cpp. References ListParameters(), and Usage(). Referenced by operator()(). |
|
List keyword/type pairs.
Reimplemented in CDigitizerModule. |
|
List keyword/type pairs. List the allowed configuration keywords. The words are returned as a string of pairs. The pairs are not a bracketed list, but just a pair of words. the first word of each pair is the command keyword. the second word is the parameter format as returned from CConfigurationParameter::GetParameterFormat()
Reimplemented in CDigitizerModule. Definition at line 742 of file CConfigurableObject.cpp. References m_Configuration, and ParameterIterator. Referenced by Usage(). |
|
List configuration.
Reimplemented in CDigitizerModule. |
|
List configuration. Produces a list of the configuration parameters that match the input pattern.
Definition at line 715 of file CConfigurableObject.cpp. References m_Configuration, and ParameterIterator. Referenced by ListConfiguration(). |
|
Process commands.
Reimplemented in CReadOrder, CDigitizerModule, and CReadOrder. |
|
Process commands. Processes the module's command. The default implementation is to look for matches of the pArgs[1] with:
Reimplemented in CReadOrder, CDigitizerModule, and CReadOrder. Definition at line 359 of file CConfigurableObject.cpp. References Configure(), ListConfiguration(), m_sName, and Usage(). Referenced by CReadOrder::operator()(). |
|
|
|
|
|
|
|
|
|
Config param number of items.
Reimplemented in CReadOrder. |
|
Config param number of items.
Reimplemented in CReadOrder. Definition at line 702 of file CConfigurableObject.cpp. References m_Configuration. |
|
Returns a string describing the command usage. The defafult implementation produces a string of the form: m_sName config Paramdescription m_sName cget m_sName help Paramdescription is produced by iterating through the set of configuration parameter descriptions and for each of them listing the name and the type expected e.g.:
Reimplemented in CReadOrder, CDigitizerModule, and CReadOrder. Definition at line 658 of file CConfigurableObject.cpp. References ListKeywords(), and m_sName. Referenced by Configure(), ListConfiguration(), operator()(), and CReadOrder::Usage(). |
|
The configuration.
Reimplemented in CDigitizerModule. Definition at line 344 of file include/CConfigurableObject.h. Referenced by AddBoolParam(), AddIntArrayParam(), AddIntParam(), AddStringArrayParam(), AddStringParam(), begin(), Configure(), DeleteParameters(), end(), Find(), ListKeywords(), ListParameters(), and size(). |
|
Name of the command associated with the object.
Reimplemented in CDigitizerModule. Definition at line 344 of file CConfigurableObject.h. Referenced by getName(), operator()(), and Usage(). |