Belle II Software development
|
Base accessor class to store different DBObjects e.g. More...
#include <GlobalParam.h>
Public Member Functions | |
GlobalParamSetAccess () | |
Constructor. | |
virtual | ~GlobalParamSetAccess () |
Virtual destructor (base class, but with no members) | |
virtual unsigned short | getGlobalUniqueID () const =0 |
implement: Get the global unique id of DBObject | |
virtual double | getGlobalParam (unsigned short, unsigned short)=0 |
implement: get a global parameter value based on the element number in the DBObject and its parameter number. | |
virtual void | setGlobalParam (double, unsigned short, unsigned short)=0 |
implemtn: set a global param value by element and param number | |
virtual std::vector< std::pair< unsigned short, unsigned short > > | listGlobalParams ()=0 |
implement: generate list of all global parameters in the DBObject | |
virtual void | updateGlobalParam (double correction, unsigned short element, unsigned short param) |
Sum value of global element param with a correction. | |
virtual TObject * | getDBObj ()=0 |
Get a raw pointer to the internal DB object (can be nullptr if not yet constructed) Use with caution - always check for nullptr. | |
virtual std::string | getDefaultName () const =0 |
Get the default DBObject name used by datastore. | |
virtual TObject * | releaseObject ()=0 |
Release the object from internal unique_ptr to be managed elsewhere Useful to pass it to be stored in DB (and thus later deleted by framework) | |
virtual GlobalParamSetAccess * | clone ()=0 |
Clone the object, making a copy of the internal object - has to be implemented in derived template class to return the actuall type of the object. | |
virtual void | loadFromDB (EventMetaData emd)=0 |
Load the content (by copying obj retrieved from DB) for a given exp/run/event. | |
virtual void | loadFromDBObjPtr ()=0 |
Load using DBObjPtr<DBObjType> which uses current EventMetaData to load valid constants. | |
virtual void | construct ()=0 |
Construct the internal DBObject. | |
virtual bool | isConstructed () const =0 |
Has the internal DBObject been already constructed The object is constructed at latest on first access to its parameters. | |
virtual bool | hasBeenChangedInDB (bool resetChangedState=true) final |
Has the object been updated in DB since GlobalParamSet<...> has been constructed? Since last call to this function with resetChangedState=true. | |
virtual void | callbackDB () |
Function to call when object has been changed in DB since last loaded. | |
template<class DBObjType > | |
bool | is () const |
Is this set of given type? | |
bool | empty () |
Is this set empty or otherwise 'invalid' to identify null sets, end of hierarchy. | |
operator bool () | |
Tentative operator to quickly check the set Returns true when the set is not empty() and the DB object is constructed and can be accessed. | |
Protected Attributes | |
bool | m_hasBeenChangedInDB {false} |
Flag for object changed in DB. | |
Base accessor class to store different DBObjects e.g.
in a vector but allow to access their stored global parameters
Definition at line 95 of file GlobalParam.h.
|
inline |
|
inlinevirtual |
Virtual destructor (base class, but with no members)
Definition at line 100 of file GlobalParam.h.
|
inlinevirtual |
Function to call when object has been changed in DB since last loaded.
Reimplemented in GlobalParamSet< DBObjType >, and GlobalParamSet< Belle2::alignment::EmptyGlobalParamSet >.
Definition at line 139 of file GlobalParam.h.
|
pure virtual |
Clone the object, making a copy of the internal object - has to be implemented in derived template class to return the actuall type of the object.
Implemented in GlobalParamSet< DBObjType >, and GlobalParamSet< Belle2::alignment::EmptyGlobalParamSet >.
|
pure virtual |
Construct the internal DBObject.
Implemented in GlobalParamSet< DBObjType >, and GlobalParamSet< Belle2::alignment::EmptyGlobalParamSet >.
|
inline |
Is this set empty or otherwise 'invalid' to identify null sets, end of hierarchy.
Definition at line 148 of file GlobalParam.h.
|
pure virtual |
Get a raw pointer to the internal DB object (can be nullptr if not yet constructed) Use with caution - always check for nullptr.
Implemented in GlobalParamSet< DBObjType >, and GlobalParamSet< Belle2::alignment::EmptyGlobalParamSet >.
|
pure virtual |
Get the default DBObject name used by datastore.
Implemented in GlobalParamSet< DBObjType >, and GlobalParamSet< Belle2::alignment::EmptyGlobalParamSet >.
|
pure virtual |
implement: get a global parameter value based on the element number in the DBObject and its parameter number.
Might be that element/param is zero. Check the meaning in DB object
Implemented in GlobalParamSet< DBObjType >, GlobalParamSet< Belle2::alignment::EmptyGlobalParamSet >, GlobalParamSet< DBObjType >, GlobalParamSet< Belle2::alignment::EmptyGlobalParamSet >, GlobalParamSet< DBObjType >, and GlobalParamSet< Belle2::alignment::EmptyGlobalParamSet >.
|
pure virtual |
implement: Get the global unique id of DBObject
Implemented in GlobalParamSet< DBObjType >, GlobalParamSet< Belle2::alignment::EmptyGlobalParamSet >, GlobalParamSet< DBObjType >, GlobalParamSet< Belle2::alignment::EmptyGlobalParamSet >, GlobalParamSet< DBObjType >, and GlobalParamSet< Belle2::alignment::EmptyGlobalParamSet >.
|
inlinefinalvirtual |
Has the object been updated in DB since GlobalParamSet<...> has been constructed? Since last call to this function with resetChangedState=true.
Definition at line 137 of file GlobalParam.h.
|
inline |
Is this set of given type?
Definition at line 144 of file GlobalParam.h.
|
pure virtual |
Has the internal DBObject been already constructed The object is constructed at latest on first access to its parameters.
Implemented in GlobalParamSet< DBObjType >, and GlobalParamSet< Belle2::alignment::EmptyGlobalParamSet >.
|
pure virtual |
implement: generate list of all global parameters in the DBObject
Implemented in GlobalParamSet< DBObjType >, GlobalParamSet< Belle2::alignment::EmptyGlobalParamSet >, GlobalParamSet< DBObjType >, GlobalParamSet< Belle2::alignment::EmptyGlobalParamSet >, GlobalParamSet< DBObjType >, and GlobalParamSet< Belle2::alignment::EmptyGlobalParamSet >.
|
pure virtual |
Load the content (by copying obj retrieved from DB) for a given exp/run/event.
Implemented in GlobalParamSet< DBObjType >, and GlobalParamSet< Belle2::alignment::EmptyGlobalParamSet >.
|
pure virtual |
Load using DBObjPtr<DBObjType> which uses current EventMetaData to load valid constants.
Implemented in GlobalParamSet< DBObjType >, and GlobalParamSet< Belle2::alignment::EmptyGlobalParamSet >.
|
inline |
Tentative operator to quickly check the set Returns true when the set is not empty() and the DB object is constructed and can be accessed.
Definition at line 167 of file GlobalParam.h.
|
pure virtual |
Release the object from internal unique_ptr to be managed elsewhere Useful to pass it to be stored in DB (and thus later deleted by framework)
Implemented in GlobalParamSet< DBObjType >, and GlobalParamSet< Belle2::alignment::EmptyGlobalParamSet >.
|
pure virtual |
implemtn: set a global param value by element and param number
Implemented in GlobalParamSet< DBObjType >, GlobalParamSet< Belle2::alignment::EmptyGlobalParamSet >, GlobalParamSet< DBObjType >, GlobalParamSet< Belle2::alignment::EmptyGlobalParamSet >, GlobalParamSet< DBObjType >, and GlobalParamSet< Belle2::alignment::EmptyGlobalParamSet >.
|
inlinevirtual |
Sum value of global element param with a correction.
Definition at line 112 of file GlobalParam.h.
|
protected |
Flag for object changed in DB.
Definition at line 174 of file GlobalParam.h.