#include <DetDesc/ParamValidDataObject.h>
Inheritance diagram for ParamValidDataObject:
Public Types | |
DEFAULT | |
ALWAYS_VALID | |
FORCE_UPDATE | |
enum | UpdateModeFlag { DEFAULT, ALWAYS_VALID, FORCE_UPDATE } |
Possible stata of the update flag. More... | |
Public Member Functions | |
ParamValidDataObject () | |
Default constructor. | |
ParamValidDataObject (const ParamValidDataObject &obj) | |
Copy constructor. | |
virtual | ~ParamValidDataObject () |
Destructor. | |
void | reset () |
Reset to the initial state. | |
virtual void | update (ValidDataObject &obj) |
Do the deep copy. | |
virtual std::ostream & | fillStream (std::ostream &s) const |
Fill the output stream (ASCII). | |
bool | exists (const std::string &name) const |
Check if the parameter with the given name exists. | |
virtual const std::type_info & | type (const std::string &name) const |
TypeId of the parameter. | |
template<class T> | |
bool | is (const std::string &name) const |
Check the type of a parameter (commodity function). | |
bool | isVector (const std::string &name) const |
Check if the parameter is a vector. | |
virtual std::string | comment (const std::string &name) const |
Get the comment of a parameter. | |
virtual void | setComment (const std::string &name, const char *comm) |
Set the comment of a parameter. | |
template<class T> | |
const T & | param (const std::string &name) const |
Give a read-only accessor to a parameter. | |
template<class T> | |
T & | param (const std::string &name) |
Give a read/write accessor to a parameter. | |
template<class T> | |
const std::vector< T > & | paramVect (const std::string &name) const |
Give a read-only accessor to a parameter vector. | |
template<class T> | |
std::vector< T > & | paramVect (const std::string &name) |
Give a read/write accessor to a parameter vector. | |
virtual const std::string & | paramAsString (const std::string &name) const |
Get the value of a parameter, as a string. | |
virtual std::string & | paramAsString (const std::string &name) |
Get the value of a parameter, as a string (non const version). | |
virtual int | paramAsInt (const std::string &name) const |
Get the value of a parameter, as an int. | |
virtual double | paramAsDouble (const std::string &name) const |
Get the value of a parameter, as a double. | |
virtual const std::vector< std::string > & | paramAsStringVect (const std::string &name) const |
Get the value of a parameter, as a string. | |
virtual std::vector< std::string > & | paramAsStringVect (const std::string &name) |
Get the value of a parameter, as a string. | |
virtual const std::vector< int > & | paramAsIntVect (const std::string &name) const |
Get the value of a parameter, as an int. | |
virtual std::vector< int > & | paramAsIntVect (const std::string &name) |
Get the value of a parameter, as an int. | |
virtual const std::vector< double > & | paramAsDoubleVect (const std::string &name) const |
Get the value of a parameter, as a double. | |
virtual std::vector< double > & | paramAsDoubleVect (const std::string &name) |
Get the value of a parameter, as a double. | |
virtual std::vector< std::string > | paramNames () const |
Returns list of existing parameter vectors as a vector of their names. | |
virtual std::string | printParams () const |
Print the parameters on a string. | |
virtual std::string | paramToString (const std::string &name, int precision) const |
Convert a parameter to a string (for xml representation). | |
template<class T> | |
void | addParam (const std::string &name, const T &value, const std::string &comment=std::string()) |
void | addBasicParam (const std::string &name, const BasicParam *p, const std::string &comment=std::string()) |
virtual StatusCode | update () |
Update the current object and all the useds one (children, references, etc) only if needed, of course. | |
virtual const CLID & | clID () const |
Class ID of this instance. | |
virtual bool | isValid () const |
Check if the data object has a well defined validity range. | |
virtual bool | isValid (const Gaudi::Time &t) const |
Check if the data object is valid at the specified time. | |
virtual const Gaudi::Time & | validSince () const |
Get start of validity. | |
virtual const Gaudi::Time & | validTill () const |
Get end of validity. | |
virtual void | setValidity (const Gaudi::Time &since, const Gaudi::Time &till) |
Set validity range. | |
virtual void | setValiditySince (const Gaudi::Time &since) |
Set start of validity. | |
virtual void | setValidityTill (const Gaudi::Time &till) |
Set end of validity. | |
virtual const UpdateModeFlag & | updateMode () const |
Return the update mode: ValidDataObject::DEFAULT -> use the actual validity ValidDataObject::ALWAYS_VALID -> never update ValidDataObject::FORCE_UPDATE -> force an update even if still valid (then back to DEFAULT behaviour). | |
virtual void | setUpdateMode (UpdateModeFlag mode) |
Set the mode for update. | |
virtual void | defaultUpdateMode () |
virtual void | forceUpdateMode () |
virtual void | neverUpdateMode () |
void | setRegistry (IRegistry *pRegistry) |
IRegistry * | registry () const |
LinkManager * | linkMgr () const |
unsigned char | version () const |
void | setVersion (unsigned char vsn) |
unsigned long | refCount () const |
virtual unsigned long | addRef () |
virtual unsigned long | release () |
const std::string & | name () const |
virtual StreamBuffer & | serialize (StreamBuffer &s) |
virtual StreamBuffer & | serialize (StreamBuffer &s) const |
Static Public Member Functions | |
static const CLID & | classID () |
Class ID of this class. | |
Private Types | |
typedef std::map< std::string, std::string > | CommentMap |
Private Attributes | |
ParamList | m_paramList |
CommentMap | m_comments |
Friends | |
friend std::ostream & | operator<< (std::ostream &s, const DataObject &obj) |
This is the basic type of condition data and detector elements in the transient data store
Andrea Valassi
Marco Clemencic
Definition at line 21 of file ParamValidDataObject.h.
typedef std::map<std::string,std::string> ParamValidDataObject::CommentMap [private] |
Definition at line 165 of file ParamValidDataObject.h.
enum ValidDataObject::UpdateModeFlag [inherited] |
Possible stata of the update flag.
Definition at line 102 of file ValidDataObject.h.
00102 { 00103 DEFAULT, 00104 ALWAYS_VALID, 00105 FORCE_UPDATE 00106 };
ParamValidDataObject::ParamValidDataObject | ( | ) |
Default constructor.
ParamValidDataObject::ParamValidDataObject | ( | const ParamValidDataObject & | obj | ) |
Copy constructor.
virtual ParamValidDataObject::~ParamValidDataObject | ( | ) | [virtual] |
Destructor.
void ParamValidDataObject::reset | ( | ) |
virtual void ParamValidDataObject::update | ( | ValidDataObject & | obj | ) | [virtual] |
virtual std::ostream& ParamValidDataObject::fillStream | ( | std::ostream & | s | ) | const [virtual] |
Fill the output stream (ASCII).
Reimplemented from ValidDataObject.
Reimplemented in AlignmentCondition.
bool ParamValidDataObject::exists | ( | const std::string & | name | ) | const |
Check if the parameter with the given name exists.
virtual const std::type_info& ParamValidDataObject::type | ( | const std::string & | name | ) | const [virtual] |
TypeId of the parameter.
bool ParamValidDataObject::is | ( | const std::string & | name | ) | const [inline] |
Check the type of a parameter (commodity function).
Definition at line 58 of file ParamValidDataObject.h.
bool ParamValidDataObject::isVector | ( | const std::string & | name | ) | const |
Check if the parameter is a vector.
virtual std::string ParamValidDataObject::comment | ( | const std::string & | name | ) | const [virtual] |
Get the comment of a parameter.
virtual void ParamValidDataObject::setComment | ( | const std::string & | name, | |
const char * | comm | |||
) | [virtual] |
Set the comment of a parameter.
const T& ParamValidDataObject::param | ( | const std::string & | name | ) | const [inline] |
Give a read-only accessor to a parameter.
Definition at line 73 of file ParamValidDataObject.h.
00073 { 00074 ParamList::const_iterator i = m_paramList.find(name); 00075 if ( i == m_paramList.end() ) throw ParamException(name); 00076 try { 00077 return i->second-> template get<T>(); 00078 } catch (std::bad_cast) { 00079 throw ParamException(name,typeid(T),i->second->type()); 00080 } 00081 }
T& ParamValidDataObject::param | ( | const std::string & | name | ) | [inline] |
Give a read/write accessor to a parameter.
Definition at line 85 of file ParamValidDataObject.h.
00085 { 00086 ParamList::iterator i = m_paramList.find(name); 00087 if ( i == m_paramList.end() ) throw ParamException(name); 00088 try { 00089 return i->second-> template get<T>(); 00090 } catch (std::bad_cast) { 00091 throw ParamException(name,typeid(T),i->second->type()); 00092 } 00093 }
const std::vector<T>& ParamValidDataObject::paramVect | ( | const std::string & | name | ) | const [inline] |
Give a read-only accessor to a parameter vector.
Definition at line 97 of file ParamValidDataObject.h.
00097 { 00098 return param<std::vector<T> >(name); 00099 }
std::vector<T>& ParamValidDataObject::paramVect | ( | const std::string & | name | ) | [inline] |
Give a read/write accessor to a parameter vector.
Definition at line 103 of file ParamValidDataObject.h.
00103 { 00104 return param<std::vector<T> >(name); 00105 }
virtual const std::string& ParamValidDataObject::paramAsString | ( | const std::string & | name | ) | const [virtual] |
Get the value of a parameter, as a string.
virtual std::string& ParamValidDataObject::paramAsString | ( | const std::string & | name | ) | [virtual] |
Get the value of a parameter, as a string (non const version).
virtual int ParamValidDataObject::paramAsInt | ( | const std::string & | name | ) | const [virtual] |
Get the value of a parameter, as an int.
virtual double ParamValidDataObject::paramAsDouble | ( | const std::string & | name | ) | const [virtual] |
Get the value of a parameter, as a double.
virtual const std::vector<std::string>& ParamValidDataObject::paramAsStringVect | ( | const std::string & | name | ) | const [virtual] |
Get the value of a parameter, as a string.
virtual std::vector<std::string>& ParamValidDataObject::paramAsStringVect | ( | const std::string & | name | ) | [virtual] |
Get the value of a parameter, as a string.
virtual const std::vector<int>& ParamValidDataObject::paramAsIntVect | ( | const std::string & | name | ) | const [virtual] |
Get the value of a parameter, as an int.
virtual std::vector<int>& ParamValidDataObject::paramAsIntVect | ( | const std::string & | name | ) | [virtual] |
Get the value of a parameter, as an int.
virtual const std::vector<double>& ParamValidDataObject::paramAsDoubleVect | ( | const std::string & | name | ) | const [virtual] |
Get the value of a parameter, as a double.
virtual std::vector<double>& ParamValidDataObject::paramAsDoubleVect | ( | const std::string & | name | ) | [virtual] |
Get the value of a parameter, as a double.
virtual std::vector<std::string> ParamValidDataObject::paramNames | ( | ) | const [virtual] |
Returns list of existing parameter vectors as a vector of their names.
virtual std::string ParamValidDataObject::printParams | ( | ) | const [virtual] |
Print the parameters on a string.
virtual std::string ParamValidDataObject::paramToString | ( | const std::string & | name, | |
int | precision | |||
) | const [virtual] |
Convert a parameter to a string (for xml representation).
void ParamValidDataObject::addParam | ( | const std::string & | name, | |
const T & | value, | |||
const std::string & | comment = std::string() | |||
) | [inline] |
Definition at line 149 of file ParamValidDataObject.h.
00149 { 00150 m_paramList.add(name,value); 00151 if (!comment.empty()) { 00152 m_comments[name] = comment; 00153 } 00154 }
void ParamValidDataObject::addBasicParam | ( | const std::string & | name, | |
const BasicParam * | p, | |||
const std::string & | comment = std::string() | |||
) | [inline] |
Definition at line 156 of file ParamValidDataObject.h.
00156 { 00157 m_paramList.addBasicParam(name,p); 00158 if (!comment.empty()) { 00159 m_comments[name] = comment; 00160 } 00161 }
virtual StatusCode ValidDataObject::update | ( | ) | [virtual, inherited] |
Update the current object and all the useds one (children, references, etc) only if needed, of course.
This method must be reimplemented for more complex objects.
virtual const CLID& ValidDataObject::clID | ( | ) | const [inline, virtual, inherited] |
Class ID of this instance.
Reimplemented from DataObject.
Reimplemented in AlignmentCondition, Condition, DetectorElement, LAssembly, LVolume, and TabulatedProperty.
Definition at line 59 of file ValidDataObject.h.
00059 { return classID(); }
static const CLID& ValidDataObject::classID | ( | ) | [inline, static, inherited] |
Class ID of this class.
Reimplemented from DataObject.
Reimplemented in AlignmentCondition, Condition, DetectorElement, LAssembly, LVolume, and TabulatedProperty.
Definition at line 62 of file ValidDataObject.h.
00062 { return CLID_ValidDataObject; }
virtual bool ValidDataObject::isValid | ( | ) | const [virtual, inherited] |
virtual bool ValidDataObject::isValid | ( | const Gaudi::Time & | t | ) | const [virtual, inherited] |
virtual const Gaudi::Time& ValidDataObject::validSince | ( | ) | const [virtual, inherited] |
virtual const Gaudi::Time& ValidDataObject::validTill | ( | ) | const [virtual, inherited] |
virtual void ValidDataObject::setValidity | ( | const Gaudi::Time & | since, | |
const Gaudi::Time & | till | |||
) | [virtual, inherited] |
virtual void ValidDataObject::setValiditySince | ( | const Gaudi::Time & | since | ) | [virtual, inherited] |
virtual void ValidDataObject::setValidityTill | ( | const Gaudi::Time & | till | ) | [virtual, inherited] |
virtual const UpdateModeFlag& ValidDataObject::updateMode | ( | ) | const [virtual, inherited] |
Return the update mode: ValidDataObject::DEFAULT -> use the actual validity
ValidDataObject::ALWAYS_VALID -> never update ValidDataObject::FORCE_UPDATE -> force an update even if still valid (then back to DEFAULT behaviour).
virtual void ValidDataObject::setUpdateMode | ( | UpdateModeFlag | mode | ) | [virtual, inherited] |
Set the mode for update.
virtual void ValidDataObject::defaultUpdateMode | ( | ) | [virtual, inherited] |
virtual void ValidDataObject::forceUpdateMode | ( | ) | [virtual, inherited] |
virtual void ValidDataObject::neverUpdateMode | ( | ) | [virtual, inherited] |
ParamList ParamValidDataObject::m_paramList [private] |
Definition at line 167 of file ParamValidDataObject.h.
CommentMap ParamValidDataObject::m_comments [private] |
Definition at line 168 of file ParamValidDataObject.h.