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

CBoolConfigParam Class Reference

#include <CBoolConfigParam.h>

Inheritance diagram for CBoolConfigParam:

Inheritance graph
[legend]
Collaboration diagram for CBoolConfigParam:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 CBoolConfigParam (const string &rName, bool fDefault=false)
 Constructor.

 ~CBoolConfigParam ()
 Destructor.

 CBoolConfigParam (const CBoolConfigParam &rhs)
 copy constructor

CBoolConfigParamoperator= (const CBoolConfigParam &rhs)
 Assignment.

int operator== (const CBoolConfigParam &rhs) const
 Equality test.

int operator!= (const CBoolConfigParam &rhs) const
bool getValue () const
bool getOptionValue ()
 get current flag.

virtual int SetValue (CTCLInterpreter &rInterp, CTCLResult &rResult, const char *pFlag)
 Parse flag.

virtual string GetParameterFormat ()
 CBoolConfigParam (const string &rName, bool fDefault=false)
 Constructor.

 ~CBoolConfigParam ()
 Destructor.

 CBoolConfigParam (const CBoolConfigParam &rhs)
 copy constructor

CBoolConfigParamoperator= (const CBoolConfigParam &rhs)
 Assignment.

int operator== (const CBoolConfigParam &rhs) const
 Equality test.

int operator!= (const CBoolConfigParam &rhs) const
bool getValue () const
bool getOptionValue ()
 get current flag.

virtual int SetValue (CTCLInterpreter &rInterp, CTCLResult &rResult, const char *pFlag)
 Parse flag.

virtual string GetParameterFormat ()

Protected Member Functions

void setBool (bool fValue)
void setBool (bool fValue)

Static Protected Member Functions

Bool_t ParseFlag (const char *value)
Bool_t ParseFlag (const char *value)

Private Attributes

bool m_fValue
 Current boolean value. :.


Detailed Description

Encapsulates a boolean parameter. Bool parameters are keyword value pairs. The value is any string that is parseable by Tcl_ExprBoolean. True values are:

An example of a parameter of this sort might be:

-eclreadout off
Turn s off ecl readout for e.g. a fera.

Definition at line 322 of file CBoolConfigParam.h.


Constructor & Destructor Documentation

CBoolConfigParam::CBoolConfigParam const string &  rName,
bool  fDefault = false
 

Constructor.

Constructor.

Parameters:
rName const string& [in] Name of the parameter (keyword recognized by config).
fDefault bool [in] Default (initial) value of the parameter.

Definition at line 295 of file CBoolConfigParam.cpp.

References CConfigurationParameter::setValue().

CBoolConfigParam::~CBoolConfigParam  ) 
 

Destructor.

Destructor

Definition at line 306 of file CBoolConfigParam.cpp.

CBoolConfigParam::CBoolConfigParam const CBoolConfigParam rhs  ) 
 

copy constructor

Copy constructor. Used to create temproraries such as for passing by value to functions.

Parameters:
rhs const CBoolConfigParam [in] The reference object we are copying.

Definition at line 315 of file CBoolConfigParam.cpp.

CBoolConfigParam::CBoolConfigParam const string &  rName,
bool  fDefault = false
 

Constructor.

CBoolConfigParam::~CBoolConfigParam  ) 
 

Destructor.

CBoolConfigParam::CBoolConfigParam const CBoolConfigParam rhs  ) 
 

copy constructor


Member Function Documentation

bool CBoolConfigParam::getOptionValue  ) 
 

get current flag.

bool CBoolConfigParam::getOptionValue  ) 
 

get current flag.

Returns the value of the parameter.

Definition at line 357 of file CBoolConfigParam.cpp.

References m_fValue.

Referenced by CReadOrder::Initialize(), CCAENV830Module::Initialize(), CCAENV775::Initialize(), and CCAENModule::Initialize().

virtual string CBoolConfigParam::GetParameterFormat  )  [virtual]
 

Implements CConfigurationParameter.

string CBoolConfigParam::GetParameterFormat  )  [virtual]
 

Returns:
The format of the configuration parameter in this case "on | off"

Implements CConfigurationParameter.

Definition at line 403 of file CBoolConfigParam.cpp.

bool CBoolConfigParam::getValue  )  const [inline]
 

Reimplemented from CConfigurationParameter.

Definition at line 343 of file include/CBoolConfigParam.h.

References m_fValue.

bool CBoolConfigParam::getValue  )  const [inline]
 

Reimplemented from CConfigurationParameter.

Definition at line 343 of file CBoolConfigParam.h.

References m_fValue.

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

Definition at line 334 of file include/CBoolConfigParam.h.

References operator==().

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

Definition at line 334 of file CBoolConfigParam.h.

References operator==().

CBoolConfigParam& CBoolConfigParam::operator= const CBoolConfigParam rhs  ) 
 

Assignment.

CBoolConfigParam & CBoolConfigParam::operator= const CBoolConfigParam rhs  ) 
 

Assignment.

Assignment

Parameters:
rhs const CBoolConfigParam& [in] The right hand parameter of the = operator.
Returns:
reference to *this.

Definition at line 328 of file CBoolConfigParam.cpp.

References m_fValue, and CConfigurationParameter::operator=().

int CBoolConfigParam::operator== const CBoolConfigParam rhs  )  const
 

Equality test.

int CBoolConfigParam::operator== const CBoolConfigParam rhs  )  const
 

Equality test.

Compare for functional equality.

Parameters:
rhs const CBoolConfigParam& [in] Right hand operand of the == operator.
Returns:
Any of:
  • 0 For inequality.
  • 1 for equality.

Definition at line 344 of file CBoolConfigParam.cpp.

References m_fValue, and CConfigurationParameter::operator==().

Referenced by operator!=().

Bool_t CBoolConfigParam::ParseFlag const char *  value  )  [static, protected]
 

Bool_t CBoolConfigParam::ParseFlag const char *  value  )  [static, protected]
 

Utility function to parse a boolean flag:

Parameters:
value const char* [in] Character value of the flag. Legal values for true are:
  • true
  • on
  • enable Legal values for false are:
  • false
  • off
  • disable
Returns:
Bool_t kfTRUE if parses as true, kfFALSE if as false, and an exception (char*) if no parse.

Definition at line 423 of file CBoolConfigParam.cpp.

Referenced by SetValue().

void CBoolConfigParam::setBool bool  fValue  )  [inline, protected]
 

Definition at line 348 of file include/CBoolConfigParam.h.

References m_fValue.

void CBoolConfigParam::setBool bool  fValue  )  [inline, protected]
 

Definition at line 348 of file CBoolConfigParam.h.

References m_fValue.

virtual int CBoolConfigParam::SetValue CTCLInterpreter &  rInterp,
CTCLResult &  rResult,
const char *  pFlag
[virtual]
 

Parse flag.

Implements CConfigurationParameter.

int CBoolConfigParam::SetValue CTCLInterpreter &  rInterp,
CTCLResult &  rResult,
const char *  pFlag
[virtual]
 

Parse flag.

Parses the parameter value. This function can fail if:

  • The parameter is not avalid bool.

Returns:
One of:
  • TCL_OK - the parse worked.
  • TCL_ERROR - the pares failed.

Implements CConfigurationParameter.

Definition at line 374 of file CBoolConfigParam.cpp.

References CConfigurationParameter::getSwitch(), m_fValue, and ParseFlag().


Member Data Documentation

bool CBoolConfigParam::m_fValue [private]
 

Current boolean value. :.

Definition at line 325 of file include/CBoolConfigParam.h.

Referenced by getOptionValue(), getValue(), operator=(), operator==(), setBool(), and SetValue().


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