Main Page | Class Hierarchy | Alphabetical List | Class List | File List | Class Members | File Members

CConfigurationParameter Class Reference

#include <CConfigurationParameter.h>

Inheritance diagram for CConfigurationParameter:

Inheritance graph
[legend]
List of all members.

Public Member Functions

 CConfigurationParameter (const string &keyword)
 Value of parameter in string form.

virtual ~CConfigurationParameter ()
 CConfigurationParameter (const CConfigurationParameter &rhs)
CConfigurationParameteroperator= (const CConfigurationParameter &rhs)
int operator== (const CConfigurationParameter &rhs) const
int operator!= (const CConfigurationParameter &rhs) const
string getSwitch () const
string getValue () const
bool Match (const string &rSwitch)
virtual int operator() (CTCLInterpreter &rInterp, CTCLResult &rResult, const char *parameter)
string getOptionString () const
virtual int SetValue (CTCLInterpreter &rInterp, CTCLResult &rResult, const char *pvalue)=0
virtual string GetParameterFormat ()=0
 CConfigurationParameter (const string &keyword)
 Value of parameter in string form.

virtual ~CConfigurationParameter ()
 CConfigurationParameter (const CConfigurationParameter &rhs)
CConfigurationParameteroperator= (const CConfigurationParameter &rhs)
int operator== (const CConfigurationParameter &rhs) const
int operator!= (const CConfigurationParameter &rhs) const
string getSwitch () const
string getValue () const
bool Match (const string &rSwitch)
virtual int operator() (CTCLInterpreter &rInterp, CTCLResult &rResult, const char *parameter)
string getOptionString () const
virtual int SetValue (CTCLInterpreter &rInterp, CTCLResult &rResult, const char *pvalue)=0
virtual string GetParameterFormat ()=0

Protected Member Functions

void setSwitch (const string am_sSwitch)
void setValue (const string am_sValue)
void setSwitch (const string am_sSwitch)
void setValue (const string am_sValue)

Private Attributes

string m_sSwitch
string m_sValue
 Switch keyword. e.g. -pedestal.


Detailed Description

This is the base class for all configuration parameter parsers. Configuration parameter parsers accept pair of

Definition at line 315 of file CConfigurationParameter.h.


Constructor & Destructor Documentation

CConfigurationParameter::CConfigurationParameter const string &  keyword  ) 
 

Value of parameter in string form.

Constructor. The configuration parameter is constructed by assigning a keyword to the object. This keyword will be recognized by the Match member function. At this time we cannot define a default for the value since that needs to be correlated with any internal representation maintained by the derive classes, and virtual functions essentially don't work virtually in constructors.

Definition at line 315 of file CConfigurationParameter.cpp.

CConfigurationParameter::~CConfigurationParameter  )  [virtual]
 

Destructor. No action is required. Since derived classes may need class specific destruction, we provide a virtual base class destructor as a placeholder to support destructor virtualization.

Definition at line 329 of file CConfigurationParameter.cpp.

CConfigurationParameter::CConfigurationParameter const CConfigurationParameter rhs  ) 
 

Copy constructor. This constructor is used by the compiler to create temporaries (e.g. in pass by value to function situtations.

Parameters:
rhs const CConfigurationParameter& [in] the object that will be cloned into us.

Definition at line 342 of file CConfigurationParameter.cpp.

CConfigurationParameter::CConfigurationParameter const string &  keyword  ) 
 

Value of parameter in string form.

virtual CConfigurationParameter::~CConfigurationParameter  )  [virtual]
 

CConfigurationParameter::CConfigurationParameter const CConfigurationParameter rhs  ) 
 


Member Function Documentation

string CConfigurationParameter::getOptionString  )  const
 

string CConfigurationParameter::getOptionString  )  const
 

Function:

Returns the current value of the parameter value as a string. We delegate to getValue.

Definition at line 452 of file CConfigurationParameter.cpp.

References getValue().

virtual string CConfigurationParameter::GetParameterFormat  )  [pure virtual]
 

Implemented in CBoolConfigParam, CIntArrayParam, CIntConfigParam, CStringArrayparam, CStringConfigParam, CBoolConfigParam, CIntArrayParam, CIntConfigParam, CStringArrayparam, and CStringConfigParam.

virtual string CConfigurationParameter::GetParameterFormat  )  [pure virtual]
 

Implemented in CBoolConfigParam, CIntArrayParam, CIntConfigParam, CStringArrayparam, CStringConfigParam, CBoolConfigParam, CIntArrayParam, CIntConfigParam, CStringArrayparam, and CStringConfigParam.

string CConfigurationParameter::getSwitch  )  const [inline]
 

Definition at line 341 of file include/CConfigurationParameter.h.

References m_sSwitch.

string CConfigurationParameter::getSwitch  )  const [inline]
 

Definition at line 341 of file CConfigurationParameter.h.

References m_sSwitch.

Referenced by CStringArrayparam::SetValue(), CIntConfigParam::SetValue(), CIntArrayParam::SetValue(), and CBoolConfigParam::SetValue().

string CConfigurationParameter::getValue  )  const [inline]
 

Reimplemented in CBoolConfigParam, and CBoolConfigParam.

Definition at line 346 of file include/CConfigurationParameter.h.

References m_sValue.

string CConfigurationParameter::getValue  )  const [inline]
 

Reimplemented in CBoolConfigParam, and CBoolConfigParam.

Definition at line 346 of file CConfigurationParameter.h.

References m_sValue.

Referenced by getOptionString(), and CStringConfigParam::getOptionValue().

bool CConfigurationParameter::Match const string &  rSwitch  ) 
 

bool CConfigurationParameter::Match const string &  rSwitch  ) 
 

Function: Returns true if the input string matches m_sSwitch. typically intended to be used in detecting which of several configuration parameters should be parsed.

Parameters:
rSwitch - const string& [in] The string to match against m_sSwitch.

Definition at line 404 of file CConfigurationParameter.cpp.

References m_sSwitch.

Referenced by CDigitizerModule::Find(), and CConfigurableObject::Find().

int CConfigurationParameter::operator!= const CConfigurationParameter rhs  )  const [inline]
 

Definition at line 333 of file include/CConfigurationParameter.h.

References operator==().

int CConfigurationParameter::operator!= const CConfigurationParameter rhs  )  const [inline]
 

Definition at line 333 of file CConfigurationParameter.h.

References operator==().

virtual int CConfigurationParameter::operator() CTCLInterpreter &  rInterp,
CTCLResult &  rResult,
const char *  parameter
[virtual]
 

int CConfigurationParameter::operator() CTCLInterpreter &  rInterp,
CTCLResult &  rResult,
const char *  parameter
[virtual]
 

Function:

Called when our keyword matches an option keyword. The new value of the parameter is saved. This is a virtual member function. The action is as follows:

  • Call SetValue
  • If SetValue returned TCL_OK, update the stringified value.
  • If SetValue failed, return to the caller without update.

Parameters:
rInterp CTCLInterpreter& [in] Interpreter that is runinng this command.
rResult CTCLResult& [in] The result object that will hold any error string if there is a problem.
parameter const char* [in] the string containing the candidate new value.
Returns:
This function can return: TCL_OK - if SetValue claims the parameter string was properl parsed. TCL_ERROR - if not.

Definition at line 432 of file CConfigurationParameter.cpp.

References m_sValue, SetValue(), and setValue().

CConfigurationParameter& CConfigurationParameter::operator= const CConfigurationParameter rhs  ) 
 

CConfigurationParameter & CConfigurationParameter::operator= const CConfigurationParameter rhs  ) 
 

Definition at line 364 of file CConfigurationParameter.cpp.

References m_sSwitch, and m_sValue.

Referenced by CStringConfigParam::operator=(), CIntConfigParam::operator=(), and CBoolConfigParam::operator=().

int CConfigurationParameter::operator== const CConfigurationParameter rhs  )  const
 

int CConfigurationParameter::operator== const CConfigurationParameter rhs  )  const
 

Determins if this is functionally equivalent to the rhs parameter. This will be true if all member data are equal.

Parameters:
rhs const CConfigurationParameter& rhs [in] The object to be compared with *this.
Returns:
Either of:
  • true if there is functional equivalence.
  • false if there is not functional equivalence.

Definition at line 385 of file CConfigurationParameter.cpp.

References m_sSwitch, and m_sValue.

Referenced by operator!=(), CStringConfigParam::operator==(), CStringArrayparam::operator==(), CIntConfigParam::operator==(), CIntArrayParam::operator==(), and CBoolConfigParam::operator==().

void CConfigurationParameter::setSwitch const string  am_sSwitch  )  [inline, protected]
 

Definition at line 355 of file include/CConfigurationParameter.h.

References m_sSwitch.

void CConfigurationParameter::setSwitch const string  am_sSwitch  )  [inline, protected]
 

Definition at line 355 of file CConfigurationParameter.h.

References m_sSwitch.

virtual int CConfigurationParameter::SetValue CTCLInterpreter &  rInterp,
CTCLResult &  rResult,
const char *  pvalue
[pure virtual]
 

Implemented in CBoolConfigParam, CIntArrayParam, CIntConfigParam, CStringArrayparam, CStringConfigParam, CBoolConfigParam, CIntArrayParam, CIntConfigParam, CStringArrayparam, and CStringConfigParam.

void CConfigurationParameter::setValue const string  am_sValue  )  [inline, protected]
 

Definition at line 359 of file include/CConfigurationParameter.h.

References m_sValue.

virtual int CConfigurationParameter::SetValue CTCLInterpreter &  rInterp,
CTCLResult &  rResult,
const char *  pvalue
[pure virtual]
 

Implemented in CBoolConfigParam, CIntArrayParam, CIntConfigParam, CStringArrayparam, CStringConfigParam, CBoolConfigParam, CIntArrayParam, CIntConfigParam, CStringArrayparam, and CStringConfigParam.

Referenced by operator()().

void CConfigurationParameter::setValue const string  am_sValue  )  [inline, protected]
 

Definition at line 359 of file CConfigurationParameter.h.

References m_sValue.

Referenced by CBoolConfigParam::CBoolConfigParam(), CIntConfigParam::CIntConfigParam(), operator()(), and CIntArrayParam::SetupStringValue().


Member Data Documentation

string CConfigurationParameter::m_sSwitch [private]
 

Definition at line 320 of file include/CConfigurationParameter.h.

Referenced by getSwitch(), Match(), operator=(), operator==(), and setSwitch().

string CConfigurationParameter::m_sValue [private]
 

Switch keyword. e.g. -pedestal.

Definition at line 321 of file include/CConfigurationParameter.h.

Referenced by getValue(), operator()(), operator=(), operator==(), and setValue().


The documentation for this class was generated from the following files:
Generated on Fri Mar 12 13:04:34 2004 for Scripted Readout by doxygen 1.3.4