| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

In This Package:

Condition Class Reference

A DataObject implementing the IParamSet, IValidity and ICondition interfaces. More...

#include <DetDesc/Condition.h>

Inheritance diagram for Condition:

[legend]
Collaboration diagram for Condition:
[legend]
List of all members.

Public Types

 DEFAULT
 ALWAYS_VALID
 FORCE_UPDATE
enum  UpdateModeFlag { DEFAULT, ALWAYS_VALID, FORCE_UPDATE }
 Possible stata of the update flag. More...

Public Member Functions

 Condition ()
 Default constructor.
 Condition (const Condition &obj)
 Copy constructor.
virtual void update (ValidDataObject &obj)
 Update using another ValidDataObject: deep copy all contents, except for the properties of a generic DataObject.
virtual std::string toXml (std::string name="", bool header=false, int precision=16) const
 Prepare an XML string representing the condition.
virtual ~Condition ()
 Destructor.
virtual StatusCode initialize ()
 This method initializes the condition.
virtual const CLIDclID () const
 Class ID of this instance.
void reset ()
 Reset to the initial state.
virtual StatusCode update ()
 Update the current object and all the useds one (children, references, etc) only if needed, of course.
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 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 UpdateModeFlagupdateMode () 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)
IRegistryregistry () const
LinkManagerlinkMgr () 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 StreamBufferserialize (StreamBuffer &s)
virtual StreamBufferserialize (StreamBuffer &s) const

Static Public Member Functions

static const CLIDclassID ()
 Class ID of this class.

Friends

friend std::ostream & operator<< (std::ostream &s, const DataObject &obj)

Detailed Description

A DataObject implementing the IParamSet, IValidity and ICondition interfaces.

This is the basic type of condition data in the transient data store (alignment, slow control, etc.).

Author:
Sebastien Ponce

Andrea Valassi

Definition at line 23 of file Condition.h.


Member Enumeration Documentation

enum ValidDataObject::UpdateModeFlag [inherited]

Possible stata of the update flag.

Enumerator:
DEFAULT 
ALWAYS_VALID 
FORCE_UPDATE 

Definition at line 102 of file ValidDataObject.h.

00102                       {
00103     DEFAULT,
00104     ALWAYS_VALID,
00105     FORCE_UPDATE
00106   };


Constructor & Destructor Documentation

Condition::Condition (  ) 

Default constructor.

Condition::Condition ( const Condition obj  ) 

Copy constructor.

virtual Condition::~Condition (  )  [virtual]

Destructor.


Member Function Documentation

virtual void Condition::update ( ValidDataObject obj  )  [virtual]

Update using another ValidDataObject: deep copy all contents, except for the properties of a generic DataObject.

Reimplemented from ParamValidDataObject.

virtual std::string Condition::toXml ( std::string  name = "",
bool  header = false,
int  precision = 16 
) const [virtual]

Prepare an XML string representing the condition.

virtual StatusCode Condition::initialize (  )  [virtual]

This method initializes the condition.

It should be overridden and used for computation purposes. This is a kind of hook for adding user code easily in the initialization of a condition.

Reimplemented in AlignmentCondition.

virtual const CLID& Condition::clID (  )  const [inline, virtual]

Class ID of this instance.

Reimplemented from ValidDataObject.

Reimplemented in AlignmentCondition.

Definition at line 57 of file Condition.h.

00057 { return classID(); } 

static const CLID& Condition::classID (  )  [inline, static]

Class ID of this class.

Reimplemented from ValidDataObject.

Reimplemented in AlignmentCondition.

Definition at line 60 of file Condition.h.

00060 { return CLID_Condition; }

void ParamValidDataObject::reset (  )  [inherited]

Reset to the initial state.

Reimplemented in DetectorElement.

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 std::ostream& ParamValidDataObject::fillStream ( std::ostream &  s  )  const [virtual, inherited]

Fill the output stream (ASCII).

Reimplemented from ValidDataObject.

Reimplemented in AlignmentCondition.

bool ParamValidDataObject::exists ( const std::string &  name  )  const [inherited]

Check if the parameter with the given name exists.

virtual const std::type_info& ParamValidDataObject::type ( const std::string &  name  )  const [virtual, inherited]

TypeId of the parameter.

template<class T>
bool ParamValidDataObject::is ( const std::string &  name  )  const [inline, inherited]

Check the type of a parameter (commodity function).

Definition at line 58 of file ParamValidDataObject.h.

00058                                               {
00059     return type(name) == typeid(T);
00060   }

bool ParamValidDataObject::isVector ( const std::string &  name  )  const [inherited]

Check if the parameter is a vector.

virtual std::string ParamValidDataObject::comment ( const std::string &  name  )  const [virtual, inherited]

Get the comment of a parameter.

virtual void ParamValidDataObject::setComment ( const std::string &  name,
const char *  comm 
) [virtual, inherited]

Set the comment of a parameter.

template<class T>
const T& ParamValidDataObject::param ( const std::string &  name  )  const [inline, inherited]

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   }

template<class T>
T& ParamValidDataObject::param ( const std::string &  name  )  [inline, inherited]

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   }

template<class T>
const std::vector<T>& ParamValidDataObject::paramVect ( const std::string &  name  )  const [inline, inherited]

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   }

template<class T>
std::vector<T>& ParamValidDataObject::paramVect ( const std::string &  name  )  [inline, inherited]

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, inherited]

Get the value of a parameter, as a string.

virtual std::string& ParamValidDataObject::paramAsString ( const std::string &  name  )  [virtual, inherited]

Get the value of a parameter, as a string (non const version).

virtual int ParamValidDataObject::paramAsInt ( const std::string &  name  )  const [virtual, inherited]

Get the value of a parameter, as an int.

virtual double ParamValidDataObject::paramAsDouble ( const std::string &  name  )  const [virtual, inherited]

Get the value of a parameter, as a double.

virtual const std::vector<std::string>& ParamValidDataObject::paramAsStringVect ( const std::string &  name  )  const [virtual, inherited]

Get the value of a parameter, as a string.

virtual std::vector<std::string>& ParamValidDataObject::paramAsStringVect ( const std::string &  name  )  [virtual, inherited]

Get the value of a parameter, as a string.

virtual const std::vector<int>& ParamValidDataObject::paramAsIntVect ( const std::string &  name  )  const [virtual, inherited]

Get the value of a parameter, as an int.

virtual std::vector<int>& ParamValidDataObject::paramAsIntVect ( const std::string &  name  )  [virtual, inherited]

Get the value of a parameter, as an int.

virtual const std::vector<double>& ParamValidDataObject::paramAsDoubleVect ( const std::string &  name  )  const [virtual, inherited]

Get the value of a parameter, as a double.

virtual std::vector<double>& ParamValidDataObject::paramAsDoubleVect ( const std::string &  name  )  [virtual, inherited]

Get the value of a parameter, as a double.

virtual std::vector<std::string> ParamValidDataObject::paramNames (  )  const [virtual, inherited]

Returns list of existing parameter vectors as a vector of their names.

virtual std::string ParamValidDataObject::printParams (  )  const [virtual, inherited]

Print the parameters on a string.

virtual std::string ParamValidDataObject::paramToString ( const std::string &  name,
int  precision 
) const [virtual, inherited]

Convert a parameter to a string (for xml representation).

template<class T>
void ParamValidDataObject::addParam ( const std::string &  name,
const T &  value,
const std::string &  comment = std::string() 
) [inline, inherited]

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, inherited]

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 bool ValidDataObject::isValid (  )  const [virtual, inherited]

Check if the data object has a well defined validity range.

Implements IValidity.

virtual bool ValidDataObject::isValid ( const Gaudi::Time &  t  )  const [virtual, inherited]

Check if the data object is valid at the specified time.

Implements IValidity.

virtual const Gaudi::Time& ValidDataObject::validSince (  )  const [virtual, inherited]

Get start of validity.

Implements IValidity.

virtual const Gaudi::Time& ValidDataObject::validTill (  )  const [virtual, inherited]

Get end of validity.

Implements IValidity.

virtual void ValidDataObject::setValidity ( const Gaudi::Time &  since,
const Gaudi::Time &  till 
) [virtual, inherited]

Set validity range.

Implements IValidity.

virtual void ValidDataObject::setValiditySince ( const Gaudi::Time &  since  )  [virtual, inherited]

Set start of validity.

Implements IValidity.

virtual void ValidDataObject::setValidityTill ( const Gaudi::Time &  till  )  [virtual, inherited]

Set end of validity.

Implements IValidity.

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]


The documentation for this class was generated from the following file:
| Classes | Job Modules | Data Objects | Services | Algorithms | Tools | Packages | Directories | Tracs |

Generated on Mon Apr 11 20:00:17 2011 for DetDesc by doxygen 1.4.7