class TrigPar

Trigger parameter dictionary class.

Public Methods

TrigPar(void)
Parameter dictionary default constructor.
TrigPar(const char *FileName)
Initializing constructor.
TrigPar(std::istream& file)
Initializing constructor.
~TrigPar(void)
Dictionary destructor.
bool exists(const std::string& ParName) const
Test whether the named parameter is defined.
Param& operator[](const std::string &Name)
Reference to the specified parameter block.
const Param& operator[](const std::string &Name) const
Constant reference to a specified parameter block.
int getInt(const std::string& ParName) const
Get an integer parameter value.
double getDouble(const std::string& ParName) const
Get the parameter value (converted to double)
std::string getString(const std::string& ParName) const
Get the parameter value (converted to string)
void addPar(const std::string& ParName, int ipar)
Add an integer parameter.
void addPar(const std::string& ParName, double dpar)
Add a double (float) parameter.
void addPar(const std::string& ParName, const std::string& spar)
Add a string parameter.
void addPar(const std::string& Name, const char *Type, const char *Value)
Add a parameter of the specified type.
void remove(const std::string& Name)
Remove the specified parameter.
void setPar(const std::string& ParName, int ipar)
Set parameter to an int
void setPar(const std::string& ParName, double dpar)
Set parameter to a double
void setPar(const std::string& ParName, const std::string& spar)
Set parameter to a string
void Read(std::istream& istr, const std::string& prefix="")
Fill parameter dictionary from the specified file.
std::ostream& Write(std::ostream& ostr, const std::string& prefix="") const
Write the parameters, their types and values to a stream.

Documentation

A trigger parameter dictionary holds a list of parameters and their values. Each parameter can be of type int, double, or string.
TrigPar(void)
Parameter dictionary default constructor.

TrigPar(const char *FileName)
Make a dictionary and add parameters as described by the file.

TrigPar(std::istream& file)
Make a dictionary and add parameters as described by the file.

~TrigPar(void)
Dictionary destructor.

bool exists(const std::string& ParName) const
Test whether the named parameter is defined.

Param& operator[](const std::string &Name)
The named parameter may be assigned a value (e.g. Dict["MyPar"] = 5;) or accessed (e.g. int = int(Dict["MyPar"]);) using the [] operator. If an undefined name is used on the left-hand-side of an assignment, the specified parameter is created with the type of the rhs of the assignment.

const Param& operator[](const std::string &Name) const
The named parameter may be assigned a value (e.g. Dict["MyPar"] = 5;) or accessed (e.g. int = int(Dict["MyPar"]);) using the [] operator. Referencing an undefined parameter will cause an exception.
Returns:
constant reference to the requested parameter object.

int getInt(const std::string& ParName) const
The value of the specified parameter is converted to integer if necessary and returned.

double getDouble(const std::string& ParName) const
Get the parameter value (converted to double)

std::string getString(const std::string& ParName) const
Get the parameter value (converted to string)

void addPar(const std::string& ParName, int ipar)
Create an integer parameter and add it to the dictionary.

void addPar(const std::string& ParName, double dpar)
Add a double (float) parameter.

void addPar(const std::string& ParName, const std::string& spar)
Add a string parameter.

void addPar(const std::string& Name, const char *Type, const char *Value)
Add a parameter of the specified type.

void remove(const std::string& Name)
Remove the specified parameter.

void setPar(const std::string& ParName, int ipar)
Set parameter to an int

void setPar(const std::string& ParName, double dpar)
Set parameter to a double

void setPar(const std::string& ParName, const std::string& spar)
Set parameter to a string

void Read(std::istream& istr, const std::string& prefix="")
Fill parameter dictionary from the specified file.

std::ostream& Write(std::ostream& ostr, const std::string& prefix="") const
Write the parameters, their types and values to a stream.


This class has no child classes.
Author:
John G Zweizig
Version:
1.2; Last Modified April 15, 1999.

alphabetic index hierarchy of classes


generated by doc++