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

CDigitizerModule Class Reference

#include <CDigitizerModule.h>

Inheritance diagram for CDigitizerModule:

Inheritance graph
[legend]
Collaboration diagram for CDigitizerModule:

Collaboration graph
[legend]
List of all members.

Public Types

typedef list< CConfigurationParameter * > ConfigArray
typedef ConfigArray::iterator ParameterIterator

Public Member Functions

 CDigitizerModule (const string &rName, CTCLInterpreter &rInterp)
virtual ~CDigitizerModule ()
 CDigitizerModule (const string &rName, CTCLInterpreter &rInterp)
virtual ~CDigitizerModule ()
string getName () const
 Retrieve a copy of the name:.

const ConfigArraygetConfiguration () const
virtual int operator() (CTCLInterpreter &rInterp, CTCLResult &rResult, int nArgs, char **pArgs)
virtual int Configure (CTCLInterpreter &rInterp, CTCLResult &rResult, int nArgs, char **pArgs)
virtual int ListConfiguration (CTCLInterpreter &rInterp, CTCLResult &rResult, int nArgs, char **pArgs)
virtual string Usage ()
virtual void Initialize ()=0
 Initialize the readable (pure virt.).

virtual void Prepare ()=0
 Prepare module for readout (pure virt.).

virtual void Read (DAQWordBufferPtr &rBuffer)=0
 Read to DAQ buf.

virtual int Read (void *pBuffer)=0
 Read to ordinary buf.

virtual void Clear ()=0
 Clear (after read e.g.).(Pure virt).

void AddIntParam (const string &sParamName, int nDefault=0)
void AddIntArrayParam (const string &rParamName, int nArraySize, int nDefault=0)
void AddBoolParam (const string &rName, bool fDefault=false)
void AddStringParam (const string &rName)
void AddStringArrayParam (const string &rName, int nArraySize)
ParameterIterator begin ()
 Config param start iterator.

ParameterIterator end ()
 Config param end iterator.

ParameterIterator Find (const string &rKeyword)
ParameterIterator Find (const char *pKeyword)
virtual string getType () const =0
 Return module type string (pure virt).


Protected Member Functions

void setName (const string am_sName)
string ListParameters (CTCLInterpreter &rInterp, const string &rPattern)
string ListKeywords ()

Private Member Functions

 CDigitizerModule (const CDigitizerModule &rhs)
CDigitizerModuleoperator= (const CDigitizerModule &rhs)
int operator== (const CDigitizerModule &rhs) const
int operator!= (const CDigitizerModule &rhs) const
 CDigitizerModule (const CDigitizerModule &rhs)
CDigitizerModuleoperator= (const CDigitizerModule &rhs)
int operator== (const CDigitizerModule &rhs) const
int operator!= (const CDigitizerModule &rhs) const
void DeleteParameters ()

Private Attributes

string m_sName
 name of module.

ConfigArray m_Configuration
 Boolean flags.


Detailed Description

Encapsulates a digitizer module. This function has two roles.

Configuration management is handled by deriving from CTCLProcessor. The object represents a new TCL command m_sName. The default parser for this command is able to handle three subcommands:

Data acquisition is done via the member functions called by the readout harness of the software:

Definition at line 313 of file CDigitizerModule.h.


Member Typedef Documentation

typedef list<CConfigurationParameter*> CDigitizerModule::ConfigArray
 

Reimplemented from CConfigurableObject.

Definition at line 347 of file include/CDigitizerModule.h.

Referenced by getConfiguration().

typedef ConfigArray::iterator CDigitizerModule::ParameterIterator
 

Reimplemented from CConfigurableObject.

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

Referenced by begin(), CCAENModule::CCAENModule(), CCAENV775::CCAENV775(), CCAENV792::CCAENV792(), CCAENV830Module::CCAENV830Module(), Configure(), DeleteParameters(), end(), Find(), CCAENV830Module::Initialize(), CCAENV792::Initialize(), CCAENV775::Initialize(), CCAENModule::Initialize(), ListKeywords(), and ListParameters().


Constructor & Destructor Documentation

CDigitizerModule::CDigitizerModule const string &  rString,
CTCLInterpreter &  rInterp
 

Constructor, creates a digitizer module. The configuration parameters can take care of themselves. The string gets initialized from the parameter.

Parameters:
sName const string& [in] The name of the module.

Definition at line 317 of file CDigitizerModule.cpp.

CDigitizerModule::~CDigitizerModule  )  [virtual]
 

Destructor. The configuration parameters pointed to by the elements of the list are assumed to be dynamically allocated. Therefore they must be deleted. The list elements themselves are assumed taken care of by the list destructors.

Definition at line 330 of file CDigitizerModule.cpp.

CDigitizerModule::CDigitizerModule const CDigitizerModule rhs  )  [private]
 

CDigitizerModule::CDigitizerModule const string &  rName,
CTCLInterpreter &  rInterp
 

virtual CDigitizerModule::~CDigitizerModule  )  [virtual]
 

CDigitizerModule::CDigitizerModule const CDigitizerModule rhs  )  [private]
 


Member Function Documentation

void CDigitizerModule::AddBoolParam const string &  rName,
bool  fDefault = false
 

Function:

Adds a boolean parameter to the set of parameters that are recognized by the default Configure parser.

Parameters:
rName const string& [in] Name of the parameter to create.
fDefault bool [in] = false Defaults value of the parameter.

Reimplemented from CConfigurableObject.

Definition at line 631 of file src/CDigitizerModule.cpp.

References m_Configuration.

void CDigitizerModule::AddIntArrayParam const string &  rParamName,
int  nArraySize,
int  nDefault = 0
 

Adds an array of parameters to the set of configuration parameter that are parsed by the default Configure function.

Parameters:
rParamName const string& [in] Name of the parameter to add.
nArraySize int [in] Size of the parameter array expected.
nDefault int [in] = 0 Default value of the array elements.

Reimplemented from CConfigurableObject.

Definition at line 609 of file src/CDigitizerModule.cpp.

References m_Configuration.

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

void CDigitizerModule::AddIntParam const string &  sParamName,
int  nDefault = 0
 

Adds an integer configuration parameter to the set recognized by the default configuration parser.

Parameters:
sParamName const string& [in] Name of parameter to add.
nDefault int [in] = 0 The default value of the parameter.

Reimplemented from CConfigurableObject.

Definition at line 587 of file src/CDigitizerModule.cpp.

References m_Configuration.

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

void CDigitizerModule::AddStringArrayParam const string &  rName,
int  nArraySize
 

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.

Parameters:
rName (const string & [in]): The name of the configuration parameter.
nArrayAzie (int [in]): The number of elements in the array.

Reimplemented from CConfigurableObject.

Definition at line 751 of file src/CDigitizerModule.cpp.

References m_Configuration.

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

void CDigitizerModule::AddStringParam const string &  rName  ) 
 

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.

Parameters:
rName (const string& [in]): Name of the new parameter.

Reimplemented from CConfigurableObject.

Definition at line 734 of file src/CDigitizerModule.cpp.

References m_Configuration.

ParameterIterator CDigitizerModule::begin  )  [inline]
 

Config param start iterator.

Returns:
CConfigurableObject::ParameterIterator Returns a begin of loop iterator that 'points' to the first configuration parameter.

Reimplemented from CConfigurableObject.

Definition at line 429 of file include/CDigitizerModule.h.

References m_Configuration, and ParameterIterator.

virtual void CDigitizerModule::Clear  )  [pure virtual]
 

Clear (after read e.g.).(Pure virt).

Implements CReadableObject.

Implemented in CCAENModule, CCAENV775, CCAENV785, CCAENV792, CCAENV830Module, CCAENModule, CCAENV775, CCAENV785, CCAENV792, and CCAENV830Module.

Referenced by CReadOrder::ModuleClear::operator()().

int CDigitizerModule::Configure CTCLInterpreter &  rInterp,
CTCLResult &  rResult,
int  nArgs,
char **  pArgs
[virtual]
 

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:

  • -threshold 5
  • -pedestals {1 2, 3 4 5 6 7 8 9}
  • -subtraction enable

Each keyword is matched against the parameters in the following order. Naturally duplicate command keys are not a good thing.

  • m_IntParameters keys that accept single integer parameters
  • m_ArrayParameters keys that accept a fixed size list of integers
  • m_BoolParameters keys that accept a boolean flag.

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.

Parameters:
rInterp CTCLInterpreter& [in] Interpreter running the command.
rResult CTCLResult [in] Result string that is filled in either by us or by the configuration dudes.
nArgs int [in] Count of remaining parameters. the first one should be the first configuration keyword.
pArgs char** [in] The text of the parameters.

Reimplemented from CConfigurableObject.

Definition at line 450 of file src/CDigitizerModule.cpp.

References Find(), m_Configuration, and ParameterIterator.

Referenced by CCAENV792Creator::Create(), CCAENV775Creator::Create(), and operator()().

void CDigitizerModule::DeleteParameters  )  [private]
 

Delete the parameter arrays.

Reimplemented from CConfigurableObject.

Definition at line 643 of file src/CDigitizerModule.cpp.

References m_Configuration, and ParameterIterator.

ParameterIterator CDigitizerModule::end  )  [inline]
 

Config param end iterator.

Returns:
CConfigurableObject::ParameterIterator Returns an end of loop iterator that points just off the end of the m_Configuration collection.

Reimplemented from CConfigurableObject.

Definition at line 432 of file include/CDigitizerModule.h.

References m_Configuration, and ParameterIterator.

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

ParameterIterator CDigitizerModule::Find const char *  pKeyword  )  [inline]
 

Definition at line 436 of file include/CDigitizerModule.h.

References Find(), and ParameterIterator.

CDigitizerModule::ParameterIterator CDigitizerModule::Find const string &  rKeyword  ) 
 

Locate a parameter matching the configuration parameter test string.

Parameters:
rKeyword The keyword to check.

Reimplemented from CConfigurableObject.

Definition at line 660 of file src/CDigitizerModule.cpp.

References m_Configuration, CConfigurationParameter::Match(), and ParameterIterator.

Referenced by CCAENModule::CCAENModule(), CCAENV775::CCAENV775(), CCAENV792::CCAENV792(), CCAENV830Module::CCAENV830Module(), Configure(), Find(), CCAENV830Module::Initialize(), CCAENV792::Initialize(), CCAENV775::Initialize(), and CCAENModule::Initialize().

const ConfigArray& CDigitizerModule::getConfiguration  )  const [inline]
 

Definition at line 380 of file include/CDigitizerModule.h.

References ConfigArray, and m_Configuration.

string CDigitizerModule::getName  )  const [inline]
 

Retrieve a copy of the name:.

Reimplemented from CConfigurableObject.

Definition at line 376 of file include/CDigitizerModule.h.

References m_sName.

Referenced by CDigitizerDictionary::DigitizerAdd(), CReadOrder::Lister::operator()(), and CReadOrder::CompareName::operator()().

virtual string CDigitizerModule::getType  )  const [pure virtual]
 

Return module type string (pure virt).

Implements CReadableObject.

Implemented in CCAENV775, CCAENV785, CCAENV792, CCAENV830Module, CCAENV775, CCAENV785, CCAENV792, and CCAENV830Module.

Referenced by CReadOrder::Lister::operator()().

virtual void CDigitizerModule::Initialize  )  [pure virtual]
 

Initialize the readable (pure virt.).

Implements CReadableObject.

Implemented in CCAENModule, CCAENV775, CCAENV785, CCAENV792, CCAENV830Module, CCAENModule, CCAENV775, CCAENV785, CCAENV792, and CCAENV830Module.

Referenced by CReadOrder::ModuleInitialize::operator()().

int CDigitizerModule::ListConfiguration CTCLInterpreter &  rInterp,
CTCLResult &  rResult,
int  nArgs,
char **  pArgs
[virtual]
 

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:

  • {threshold 5}
  • {pedestals {1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 }}
  • {subtraction on}

Note:
In the list, no distinction is made between the types of parameter values.

The string representationi is used, so the value of the bool will not be standardized, but will be whatever was used (e.g. on, 1 are both possible values.

Parameters:
rInterp CTCLInterpreter& [in] The interpreter that is running the command.
rResult CTCLResult& [in] The result string that will contain the configuration information.
nArgs int [in] Number of parameters, should be 0.
pArgs char** [in] text of parameters.
Note:
There should be at most 1 parameter. If present it is a glob pattern that will be used to filter the output. (essentially no parameter results in a pattern of *).
Returns:
Any of:
  • TCL_OK the configuraton was listed
  • TCL_ERROR the configuration could not be listed and rResult is an error string.

Reimplemented from CConfigurableObject.

Definition at line 518 of file src/CDigitizerModule.cpp.

References ListParameters(), and Usage().

Referenced by operator()().

string CDigitizerModule::ListKeywords  )  [protected]
 

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()

Returns:
string - the results of the list.

Reimplemented from CConfigurableObject.

Definition at line 710 of file src/CDigitizerModule.cpp.

References m_Configuration, and ParameterIterator.

Referenced by Usage().

string CDigitizerModule::ListParameters CTCLInterpreter &  rInterp,
const string &  rPattern
[protected]
 

Produces a list of the configuration parameters that match the input pattern.

Parameters:
rInterp CTCLInterpreter& [in] Interpreter excuting this
sPattern const string& [in] The glob string pattern.

Reimplemented from CConfigurableObject.

Definition at line 682 of file src/CDigitizerModule.cpp.

References m_Configuration, and ParameterIterator.

Referenced by ListConfiguration().

int CDigitizerModule::operator!= const CDigitizerModule rhs  )  const [private]
 

int CDigitizerModule::operator!= const CDigitizerModule rhs  )  const [private]
 

int CDigitizerModule::operator() CTCLInterpreter &  rInterp,
CTCLResult &  rResult,
int  nArgs,
char **  pArgs
[virtual]
 

Function:

Processes the module's command. The default implementation is to look for matches of the pArgs[1] with:

  • "config" calls the module's Configure member. member function.
  • "cget" calls the module's ListConfiguration member function.
  • "help" calls the module's Usage member function.

Parameters:
rInterp CTCLInterpreter& [in] Interpreter running the command.
rResult CTCLResult& [in] The result string that will be returned to the caller.
nArgs int [in] The number of parameters on the command line. Note that the first one should be m_sName.
pArgs char** [in] The command parameters.
Returns:
Either of:
  • TCL_OK if the command completed properly or
  • TCL_ERROR if the command failed.
Note:
To extend functionaly to support additional keyword, override this, check for your own keywords and if you don't find them, call the base class member with the unaltered parameters.

Reimplemented from CConfigurableObject.

Definition at line 374 of file src/CDigitizerModule.cpp.

References Configure(), ListConfiguration(), m_sName, and Usage().

CDigitizerModule& CDigitizerModule::operator= const CDigitizerModule rhs  )  [private]
 

CDigitizerModule& CDigitizerModule::operator= const CDigitizerModule rhs  )  [private]
 

int CDigitizerModule::operator== const CDigitizerModule rhs  )  const [private]
 

int CDigitizerModule::operator== const CDigitizerModule rhs  )  const [private]
 

virtual void CDigitizerModule::Prepare  )  [pure virtual]
 

Prepare module for readout (pure virt.).

Implements CReadableObject.

Implemented in CCAENModule, CCAENV775, CCAENV785, CCAENV792, CCAENV830Module, CCAENModule, CCAENV775, CCAENV785, CCAENV792, and CCAENV830Module.

Referenced by CReadOrder::ModulePrepare::operator()().

virtual int CDigitizerModule::Read void *  pBuffer  )  [pure virtual]
 

Read to ordinary buf.

Implements CReadableObject.

Implemented in CCAENModule, CCAENV830Module, CCAENModule, and CCAENV830Module.

virtual void CDigitizerModule::Read DAQWordBufferPtr &  rBuffer  )  [pure virtual]
 

Read to DAQ buf.

Implements CReadableObject.

Implemented in CCAENModule, CCAENV775, CCAENV785, CCAENV792, CCAENV830Module, CCAENModule, CCAENV775, CCAENV785, CCAENV792, and CCAENV830Module.

Referenced by CReadOrder::ModuleRead::operator()().

void CDigitizerModule::setName const string  am_sName  )  [inline, protected]
 

Definition at line 390 of file include/CDigitizerModule.h.

References m_sName.

string CDigitizerModule::Usage  )  [virtual]
 

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.:

  • theshold int
  • pedestal {int[16]}
  • subtraction on|off|enable|disable

Reimplemented from CConfigurableObject.

Definition at line 561 of file src/CDigitizerModule.cpp.

References ListKeywords(), and m_sName.

Referenced by ListConfiguration(), and operator()().


Member Data Documentation

ConfigArray CDigitizerModule::m_Configuration [private]
 

Boolean flags.

Reimplemented from CConfigurableObject.

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

Referenced by AddBoolParam(), AddIntArrayParam(), AddIntParam(), AddStringArrayParam(), AddStringParam(), begin(), Configure(), DeleteParameters(), end(), Find(), getConfiguration(), ListKeywords(), and ListParameters().

string CDigitizerModule::m_sName [private]
 

name of module.

Reimplemented from CConfigurableObject.

Definition at line 352 of file include/CDigitizerModule.h.

Referenced by getName(), operator()(), setName(), and Usage().


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