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

CIntArrayParam Class Reference

#include <CIntArrayParam.h>

Inheritance diagram for CIntArrayParam:

Inheritance graph
[legend]
Collaboration diagram for CIntArrayParam:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 CIntArrayParam (const string &rName, unsigned int size, int nDefault=0)
 largest allowed value for an element of the array.

 CIntArrayParam (const string &, unsigned int size, int nLow, int nHigh, int nDefault=0)
virtual ~CIntArrayParam ()
 CIntArrayParam (const CIntArrayParam &aCIntArrayParam)
CIntArrayParamoperator= (const CIntArrayParam &aCIntArrayParam)
int operator== (const CIntArrayParam &aCIntArrayParam) const
int operator!= (const CIntArrayParam &rhs) const
int getSize () const
const int * getValues () const
bool getCheckRange () const
int getLow () const
int getHigh () const
int & operator[] (int n)
virtual int SetValue (CTCLInterpreter &rInterp, CTCLResult &rResult, const char *pValues)
virtual string GetParameterFormat ()
void setRange (int nLow, int nHigh)
 CIntArrayParam (const string &rName, unsigned int size, int nDefault=0)
 largest allowed value for an element of the array.

 CIntArrayParam (const string &, unsigned int size, int nLow, int nHigh, int nDefault=0)
virtual ~CIntArrayParam ()
 CIntArrayParam (const CIntArrayParam &aCIntArrayParam)
CIntArrayParamoperator= (const CIntArrayParam &aCIntArrayParam)
int operator== (const CIntArrayParam &aCIntArrayParam) const
int operator!= (const CIntArrayParam &rhs) const
int getSize () const
const int * getValues () const
bool getCheckRange () const
int getLow () const
int getHigh () const
int & operator[] (int n)
virtual int SetValue (CTCLInterpreter &rInterp, CTCLResult &rResult, const char *pValues)
virtual string GetParameterFormat ()
void setRange (int nLow, int nHigh)

Protected Member Functions

void setSize (const int am_nSize)
void setValues (int *am_aValues)
void setCheckRange (const bool am_fCheckRange)
void setLow (const int am_nLow)
void setHigh (const int am_nHigh)
void SetupArray (int nDefault)
void CopyArray (const CIntArrayParam &rhs)
void SetupStringValue ()
void setSize (const int am_nSize)
void setValues (int *am_aValues)
void setCheckRange (const bool am_fCheckRange)
void setLow (const int am_nLow)
void setHigh (const int am_nHigh)
void SetupArray (int nDefault)
void CopyArray (const CIntArrayParam &rhs)
void SetupStringValue ()

Private Attributes

int m_nSize
int * m_aValues
 Size of the array.

bool m_fCheckRange
 Fixed size array for the values.

int m_nLow
 true if range checking is to be enabled.

int m_nHigh
 Smallest allowed value for the parameter.

int * m_aValues
 Size of the array.


Detailed Description

Encapsulates a parameter that is aray valued. An example of an array valued parameter is a set of pedestals one per digitizer channel. The array is passed in as a welll formed TCL list, each of whose elements will evailuate to an integer.

Definition at line 311 of file CIntArrayParam.h.


Constructor & Destructor Documentation

CIntArrayParam::CIntArrayParam const string &  rName,
unsigned int  nSize,
int  nDefault = 0
 

largest allowed value for an element of the array.

Constructor: Constructs an array that is not range checked. The array is filled in from a TCL formatted list.

Parameters:
rName const string& [in] The parameter name recognized by the configuration parser.
size unsigned int [in] Number of integers in the array.
nDefault int [in] Default (initial) value of the array elements.

Definition at line 308 of file CIntArrayParam.cpp.

References SetupArray(), and SetupStringValue().

CIntArrayParam::CIntArrayParam const string &  rName,
unsigned int  nSize,
int  nLow,
int  nHigh,
int  nDefault = 0
 

Constructor for a range checked array. Range checking causes modification of the array to fail if the value of the parameter is not in the interval [m_nLow, m_nHigh].

Parameters:
rName const string [in] Name of the parameter.
nSize int [in] Number of elements in the array.
nLow,nHigh int [in] Range limits.
nDefault int [in] Default value.

Definition at line 334 of file CIntArrayParam.cpp.

References SetupArray(), and SetupStringValue().

CIntArrayParam::~CIntArrayParam  )  [virtual]
 

Destructor

Definition at line 353 of file CIntArrayParam.cpp.

References m_aValues.

CIntArrayParam::CIntArrayParam const CIntArrayParam rhs  ) 
 

Copy construction: Used to build temporary objects e.g. for pass by value function parameters.

Parameters:
rhs const CIntArrayParam& [in] the source for the copy.

Definition at line 365 of file CIntArrayParam.cpp.

References CopyArray(), m_fCheckRange, m_nHigh, m_nLow, and m_nSize.

CIntArrayParam::CIntArrayParam const string &  rName,
unsigned int  size,
int  nDefault = 0
 

largest allowed value for an element of the array.

CIntArrayParam::CIntArrayParam const string &  ,
unsigned int  size,
int  nLow,
int  nHigh,
int  nDefault = 0
 

virtual CIntArrayParam::~CIntArrayParam  )  [virtual]
 

CIntArrayParam::CIntArrayParam const CIntArrayParam aCIntArrayParam  ) 
 


Member Function Documentation

void CIntArrayParam::CopyArray const CIntArrayParam rhs  )  [protected]
 

void CIntArrayParam::CopyArray const CIntArrayParam rhs  )  [protected]
 

Protected helper function to copy the array from some other source.

Parameters:
rhs const CIntArrayParam& [in] The source of the array.

Definition at line 591 of file CIntArrayParam.cpp.

References m_aValues, m_nSize, and SetupArray().

Referenced by CIntArrayParam(), and operator=().

bool CIntArrayParam::getCheckRange  )  const [inline]
 

Definition at line 353 of file include/CIntArrayParam.h.

References m_fCheckRange.

bool CIntArrayParam::getCheckRange  )  const [inline]
 

Definition at line 353 of file CIntArrayParam.h.

References m_fCheckRange.

int CIntArrayParam::getHigh  )  const [inline]
 

Definition at line 361 of file include/CIntArrayParam.h.

References m_nHigh.

int CIntArrayParam::getHigh  )  const [inline]
 

Definition at line 361 of file CIntArrayParam.h.

References m_nHigh.

int CIntArrayParam::getLow  )  const [inline]
 

Definition at line 357 of file include/CIntArrayParam.h.

References m_nLow.

int CIntArrayParam::getLow  )  const [inline]
 

Definition at line 357 of file CIntArrayParam.h.

References m_nLow.

virtual string CIntArrayParam::GetParameterFormat  )  [virtual]
 

Implements CConfigurationParameter.

string CIntArrayParam::GetParameterFormat  )  [virtual]
 

Returns:
the format of the configuration parameter in this case, int[n] where n is the stringified of the array size.

Implements CConfigurationParameter.

Definition at line 562 of file CIntArrayParam.cpp.

References m_nSize.

int CIntArrayParam::getSize  )  const [inline]
 

Definition at line 345 of file include/CIntArrayParam.h.

References m_nSize.

int CIntArrayParam::getSize  )  const [inline]
 

Definition at line 345 of file CIntArrayParam.h.

References m_nSize.

const int* CIntArrayParam::getValues  )  const [inline]
 

Definition at line 349 of file include/CIntArrayParam.h.

References m_aValues.

const int* CIntArrayParam::getValues  )  const [inline]
 

Definition at line 349 of file CIntArrayParam.h.

References m_aValues.

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

Definition at line 338 of file include/CIntArrayParam.h.

References operator==().

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

Definition at line 338 of file CIntArrayParam.h.

References operator==().

CIntArrayParam& CIntArrayParam::operator= const CIntArrayParam aCIntArrayParam  ) 
 

CIntArrayParam & CIntArrayParam::operator= const CIntArrayParam rhs  ) 
 

Assignment operator. Do a deep copy.

Parameters:
rhs const CIntArrayParam& [in] The right hand side of the assignment operator.
Returns:
*this.

Definition at line 387 of file CIntArrayParam.cpp.

References CopyArray(), m_fCheckRange, m_nHigh, m_nLow, and m_nSize.

int CIntArrayParam::operator== const CIntArrayParam aCIntArrayParam  )  const
 

int CIntArrayParam::operator== const CIntArrayParam rhs  )  const
 

Test for functional equality. Functional equality is achieved when all members are equal except the arrays whose contents must be identical. This function is invoked for *this == rhs expressions.

Parameters:
rhs const CIntArraryParam& [in] Right hand side of comparison.
Returns:
Comparison results:
  • true if *this is functionally equivalent to rhs.
  • false if not.

Definition at line 412 of file CIntArrayParam.cpp.

References m_aValues, m_fCheckRange, m_nHigh, m_nLow, m_nSize, and CConfigurationParameter::operator==().

Referenced by operator!=().

int& CIntArrayParam::operator[] int  n  ) 
 

int & CIntArrayParam::operator[] int  n  ) 
 

Returns a reference to the corresponding array elemnt. If the index is out of range CRangeError is thrown. This function satisfies attempts to do things like this[i].

Parameters:
n int [in] The array index.
Returns:
A reference to the n'th element of m_aValues.
Exceptions:
CRangeError if n is out of the range of valid indices.

Definition at line 447 of file CIntArrayParam.cpp.

References m_aValues, and m_nSize.

void CIntArrayParam::setCheckRange const bool  am_fCheckRange  )  [inline, protected]
 

Definition at line 378 of file include/CIntArrayParam.h.

References m_fCheckRange.

void CIntArrayParam::setCheckRange const bool  am_fCheckRange  )  [inline, protected]
 

Definition at line 378 of file CIntArrayParam.h.

References m_fCheckRange.

void CIntArrayParam::setHigh const int  am_nHigh  )  [inline, protected]
 

Definition at line 386 of file include/CIntArrayParam.h.

References m_nHigh.

void CIntArrayParam::setHigh const int  am_nHigh  )  [inline, protected]
 

Definition at line 386 of file CIntArrayParam.h.

References m_nHigh.

void CIntArrayParam::setLow const int  am_nLow  )  [inline, protected]
 

Definition at line 382 of file include/CIntArrayParam.h.

References m_nLow.

void CIntArrayParam::setLow const int  am_nLow  )  [inline, protected]
 

Definition at line 382 of file CIntArrayParam.h.

References m_nLow.

void CIntArrayParam::setRange int  nLow,
int  nHigh
[inline]
 

Definition at line 399 of file include/CIntArrayParam.h.

References m_fCheckRange, m_nHigh, and m_nLow.

void CIntArrayParam::setRange int  nLow,
int  nHigh
[inline]
 

Definition at line 399 of file CIntArrayParam.h.

References m_fCheckRange, m_nHigh, and m_nLow.

Referenced by CCAENModule::CCAENModule(), and CCAENV830Module::CCAENV830Module().

void CIntArrayParam::setSize const int  am_nSize  )  [inline, protected]
 

Definition at line 370 of file include/CIntArrayParam.h.

References m_nSize.

void CIntArrayParam::setSize const int  am_nSize  )  [inline, protected]
 

Definition at line 370 of file CIntArrayParam.h.

References m_nSize.

void CIntArrayParam::SetupArray int  nDefault  )  [protected]
 

void CIntArrayParam::SetupArray int  nDefault  )  [protected]
 

Protected helper functio to create and initialize the array:

Parameters:
nDefault int [in] The value to initialize elements of the array to.

Definition at line 576 of file CIntArrayParam.cpp.

References m_aValues, and m_nSize.

Referenced by CIntArrayParam(), and CopyArray().

void CIntArrayParam::SetupStringValue  )  [protected]
 

void CIntArrayParam::SetupStringValue  )  [protected]
 

Given the current values of the array, sets the string version of the parameter's value.

Definition at line 605 of file CIntArrayParam.cpp.

References m_aValues, m_nSize, and CConfigurationParameter::setValue().

Referenced by CIntArrayParam().

virtual int CIntArrayParam::SetValue CTCLInterpreter &  rInterp,
CTCLResult &  rResult,
const char *  pValues
[virtual]
 

Implements CConfigurationParameter.

int CIntArrayParam::SetValue CTCLInterpreter &  rInterp,
CTCLResult &  rResult,
const char *  pValues
[virtual]
 

Sets the array value from a parameter that is assumed to be a well formed Tcl list. This function will fail if:

  • Any of the array values does not parse as an integer.
  • Any of the array values is outside the range: [m_nLow, m_nHigh] and m_fCheckrange is true;.
  • The size of the list does not match exactly m_nSize.

Parameters:
rInterp CTCLInterpreter& [in] The interpreter that is running the module config command.
rResult CTCLResult& [in] The result string. Will be empty on a clean run and have a descriptive error message otherwise.
pValues char* [in] The string containing the parameter list.
Returns:
Status of the parse:
  • TCL_OK on normal completion.
  • TCL_ERROR on failure in this case a descriptive error message will be put in rResult.

Implements CConfigurationParameter.

Definition at line 481 of file CIntArrayParam.cpp.

References CConfigurationParameter::getSwitch(), m_aValues, m_fCheckRange, m_nHigh, and m_nSize.

void CIntArrayParam::setValues int *  am_aValues  )  [inline, protected]
 

Definition at line 374 of file include/CIntArrayParam.h.

References m_aValues.

void CIntArrayParam::setValues int *  am_aValues  )  [inline, protected]
 

Definition at line 374 of file CIntArrayParam.h.

References m_aValues.


Member Data Documentation

int* CIntArrayParam::m_aValues [private]
 

Size of the array.

Definition at line 317 of file include/CIntArrayParam.h.

int* CIntArrayParam::m_aValues [private]
 

Size of the array.

Definition at line 317 of file CIntArrayParam.h.

Referenced by CopyArray(), getValues(), operator==(), operator[](), SetupArray(), SetupStringValue(), SetValue(), setValues(), and ~CIntArrayParam().

bool CIntArrayParam::m_fCheckRange [private]
 

Fixed size array for the values.

Definition at line 318 of file include/CIntArrayParam.h.

Referenced by CIntArrayParam(), getCheckRange(), operator=(), operator==(), setCheckRange(), setRange(), and SetValue().

int CIntArrayParam::m_nHigh [private]
 

Smallest allowed value for the parameter.

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

Referenced by CIntArrayParam(), getHigh(), operator=(), operator==(), setHigh(), setRange(), and SetValue().

int CIntArrayParam::m_nLow [private]
 

true if range checking is to be enabled.

Definition at line 319 of file include/CIntArrayParam.h.

Referenced by CIntArrayParam(), getLow(), operator=(), operator==(), setLow(), and setRange().

int CIntArrayParam::m_nSize [private]
 

Definition at line 316 of file include/CIntArrayParam.h.

Referenced by CIntArrayParam(), CopyArray(), GetParameterFormat(), getSize(), operator=(), operator==(), operator[](), setSize(), SetupArray(), SetupStringValue(), and SetValue().


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