DD4hep
1.30.0
Detector Description Toolkit for High Energy Physics
|
Basic conditions manager implementation. More...
#include <ConditionsManagerObject.h>
Public Types | |
typedef Condition::key_type | key_type |
typedef std::pair< ConditionsListener *, void * > | Listener |
typedef std::set< Listener > | Listeners |
typedef std::unique_ptr< ConditionsDataLoader > | Loader |
typedef ConditionsManager::Result | Result |
Public Member Functions | |
ConditionsManagerObject (Detector &description) | |
Default constructor. More... | |
virtual | ~ConditionsManagerObject () |
Default destructor. More... | |
Detector & | detectorDescription () const |
Access to the detector description instance. More... | |
ConditionsDataLoader * | loader () const |
Access to the data loader. More... | |
bool | doLoadConditions () const |
Access to load flag. More... | |
bool | doOutputUnloaded () const |
Access to flag to indicate if unloaded items should be saved to the slice (or not) More... | |
void | onRegister (Condition condition) |
Listener invocation when a condition is registered to the cache. More... | |
void | onRemove (Condition condition) |
Listener invocation when a condition is deregistered from the cache. More... | |
void | callOnRegister (const Listener &callee, bool add) |
(Un)Registration of conditions listeners with callback when a new condition is registered More... | |
void | callOnRemove (const Listener &callee, bool add) |
(Un)Registration of conditions listeners with callback when a condition is unregistered More... | |
const std::vector< const IOVType * > | iovTypesUsed () const |
Access the used/registered IOV types. More... | |
void | fromString (const std::string &iov_str, IOV &iov) |
Create IOV from string. More... | |
ConditionsPool * | registerIOV (const std::string &data) |
Register IOV using new string data. More... | |
virtual void | initialize ()=0 |
Initialize the object after having set the properties. More... | |
virtual const std::vector< IOVType > & | iovTypes () const =0 |
Access IOV by its type. More... | |
virtual const IOVType * | iovType (size_t iov_type) const =0 |
Access IOV by its type. More... | |
virtual const IOVType * | iovType (const std::string &iov_name) const =0 |
Access IOV by its name. More... | |
virtual std::pair< bool, const IOVType * > | registerIOVType (size_t iov_type, const std::string &iov_name)=0 |
Register new IOV type if it does not (yet) exist. More... | |
virtual ConditionsPool * | registerIOV (const IOVType &typ, IOV::Key key)=0 |
Register IOV with type and key (much more performant...) More... | |
virtual ConditionsIOVPool * | iovPool (const IOVType &type) const =0 |
Access conditions multi IOV pool by iov type. More... | |
virtual void | pushUpdates ()=0 |
Push all pending updates to the conditions store. More... | |
virtual bool | registerUnlocked (ConditionsPool &pool, Condition cond)=0 |
Register new condition with the conditions store. Unlocked version, not multi-threaded. More... | |
virtual size_t | blockRegister (ConditionsPool &pool, const std::vector< Condition > &cond) const =0 |
Register a whole block of conditions with identical IOV. More... | |
virtual std::unique_ptr< UserPool > | createUserPool (const IOVType *iovT) const =0 |
Create empty user pool object. More... | |
virtual Result | prepare (const IOV &req_iov, ConditionsSlice &slice, ConditionUpdateUserContext *ctx=0)=0 |
Prepare all updates to the clients with the defined IOV. More... | |
virtual Result | load (const IOV &required_validity, ConditionsSlice &slice, ConditionUpdateUserContext *ctxt=0)=0 |
Load all updates to the clients with the defined IOV (1rst step of prepare) More... | |
virtual Result | compute (const IOV &required_validity, ConditionsSlice &slice, ConditionUpdateUserContext *ctxt=0)=0 |
Compute all derived conditions with the defined IOV (2nd step of prepare) More... | |
virtual void | adoptCleanup (ConditionsCleanup *cleaner)=0 |
Adopt cleanup handler. If a handler is registered, it is invoked at every "prepare" step. More... | |
virtual int | clean (const IOVType *typ, int max_age)=0 |
Clean conditions, which are above the age limit. More... | |
virtual std::pair< int, int > | clean (const ConditionsCleanup &cleaner)=0 |
Invoke cache cleanup with user defined policy. More... | |
virtual std::pair< int, int > | clear ()=0 |
Full cleanup of all managed conditions. More... | |
Public Member Functions inherited from dd4hep::NamedObject | |
NamedObject (const char *nam, const char *typ="") | |
Initializing constructor. More... | |
NamedObject (const std::string &nam) | |
Initializing constructor. More... | |
NamedObject (const std::string &nam, const std::string &typ) | |
Initializing constructor. More... | |
NamedObject ()=default | |
Standard constructor. More... | |
NamedObject (const NamedObject &c)=default | |
Copy constructor. More... | |
NamedObject (NamedObject &&c)=default | |
Move constructor. More... | |
virtual | ~NamedObject ()=default |
Default destructor. More... | |
NamedObject & | operator= (const NamedObject &c)=default |
Assignment operator. More... | |
NamedObject & | operator= (NamedObject &&c)=default |
Move assignment operator. More... | |
const char * | GetName () const |
Access name. More... | |
void | SetName (const char *nam) |
Set name (used by Handle) More... | |
void | SetTitle (const char *tit) |
Set Title (used by Handle) More... | |
const char * | GetTitle () const |
Get name (used by Handle) More... | |
Public Member Functions inherited from dd4hep::PropertyConfigurable | |
PropertyConfigurable () | |
Standard constructor. More... | |
virtual | ~PropertyConfigurable () |
Default destructor. More... | |
virtual PropertyManager & | properties () override |
Access to the properties of the object. More... | |
virtual const PropertyManager & | properties () const override |
Access to the properties of the object. More... | |
virtual bool | hasProperty (const std::string &name) const override |
Check property for existence. More... | |
virtual Property & | property (const std::string &name) override |
Access single property. More... | |
template<typename T > | |
void | declareProperty (const std::string &nam, T &val) |
Declare property. More... | |
template<typename T > | |
void | declareProperty (const char *nam, T &val) |
Declare property. More... | |
Public Member Functions inherited from dd4hep::PropertyInterface | |
virtual | ~PropertyInterface ()=default |
Default destructor. More... | |
Protected Member Functions | |
void | registerCallee (Listeners &listeners, const Listener &callee, bool add) |
Register callback listener object. More... | |
Protected Attributes | |
Detector & | m_detDesc |
Reference to main detector description object. More... | |
Listeners | m_onRegister |
Conditions listeners on registration of new conditions. More... | |
Listeners | m_onRemove |
Conditions listeners on de-registration of new conditions. More... | |
Loader | m_loader |
Reference to the data loader userd by this instance. More... | |
bool | m_doLoad = true |
Property: Flag to indicate if items should be loaded (or not) More... | |
bool | m_doOutputUnloaded = false |
Property: Flag to indicate if unloaded items should be saved to the slice (or not) More... | |
Protected Attributes inherited from dd4hep::PropertyConfigurable | |
PropertyManager | m_properties |
Property pool. More... | |
Additional Inherited Members | |
Public Attributes inherited from dd4hep::NamedObject | |
std::string | name |
The object name. More... | |
std::string | type |
The object type. More... | |
Basic conditions manager implementation.
This class implements the basic functionality of the conditions manager. To allow for specialization, the important functions are kept virtual. For performance reasons these are mostly functions, which either are called elatively rarely or are bulk functions.
Definition at line 52 of file ConditionsManagerObject.h.
Definition at line 56 of file ConditionsManagerObject.h.
typedef std::pair<ConditionsListener*,void*> dd4hep::cond::ConditionsManagerObject::Listener |
Definition at line 57 of file ConditionsManagerObject.h.
typedef std::set<Listener> dd4hep::cond::ConditionsManagerObject::Listeners |
Definition at line 58 of file ConditionsManagerObject.h.
typedef std::unique_ptr<ConditionsDataLoader> dd4hep::cond::ConditionsManagerObject::Loader |
Definition at line 59 of file ConditionsManagerObject.h.
Definition at line 60 of file ConditionsManagerObject.h.
ConditionsManagerObject::ConditionsManagerObject | ( | Detector & | description | ) |
Default constructor.
Definition at line 47 of file ConditionsManager.cpp.
|
virtual |
Default destructor.
Definition at line 56 of file ConditionsManager.cpp.
|
pure virtual |
Adopt cleanup handler. If a handler is registered, it is invoked at every "prepare" step.
Note: This may be convenient under certain circumstances, however at the expense of more flexible approaches to perform the conditions data cleanup. Any previously registered instance shall be deleted.
Implemented in dd4hep::cond::Manager_Type1.
|
pure virtual |
Register a whole block of conditions with identical IOV.
Implemented in dd4hep::cond::Manager_Type1.
void ConditionsManagerObject::callOnRegister | ( | const Listener & | callee, |
bool | add | ||
) |
(Un)Registration of conditions listeners with callback when a new condition is registered
Definition at line 72 of file ConditionsManager.cpp.
void ConditionsManagerObject::callOnRemove | ( | const Listener & | callee, |
bool | add | ||
) |
(Un)Registration of conditions listeners with callback when a condition is unregistered
(Un)Registration of conditions listeners with callback when a condition is de-registered
Definition at line 77 of file ConditionsManager.cpp.
|
pure virtual |
Invoke cache cleanup with user defined policy.
Implemented in dd4hep::cond::Manager_Type1.
|
pure virtual |
Clean conditions, which are above the age limit.
Implemented in dd4hep::cond::Manager_Type1.
|
pure virtual |
Full cleanup of all managed conditions.
Implemented in dd4hep::cond::Manager_Type1.
|
pure virtual |
Compute all derived conditions with the defined IOV (2nd step of prepare)
Implemented in dd4hep::cond::Manager_Type1.
|
pure virtual |
Create empty user pool object.
Implemented in dd4hep::cond::Manager_Type1.
|
inline |
Access to the detector description instance.
Definition at line 88 of file ConditionsManagerObject.h.
|
inline |
Access to load flag.
Definition at line 94 of file ConditionsManagerObject.h.
|
inline |
Access to flag to indicate if unloaded items should be saved to the slice (or not)
Definition at line 97 of file ConditionsManagerObject.h.
void ConditionsManagerObject::fromString | ( | const std::string & | iov_str, |
IOV & | iov | ||
) |
Create IOV from string.
Need assignment from long (k1,k2) for compatibility with Apple MAC
Definition at line 104 of file ConditionsManager.cpp.
|
pure virtual |
Initialize the object after having set the properties.
Overloadable interface
Implemented in dd4hep::cond::Manager_Type1.
|
pure virtual |
Access conditions multi IOV pool by iov type.
Implemented in dd4hep::cond::Manager_Type1.
|
pure virtual |
Access IOV by its name.
Implemented in dd4hep::cond::Manager_Type1.
|
pure virtual |
Access IOV by its type.
Implemented in dd4hep::cond::Manager_Type1.
|
pure virtual |
Access IOV by its type.
Implemented in dd4hep::cond::Manager_Type1.
const std::vector< const dd4hep::IOVType * > ConditionsManagerObject::iovTypesUsed | ( | ) | const |
Access the used/registered IOV types.
Definition at line 94 of file ConditionsManager.cpp.
|
pure virtual |
Load all updates to the clients with the defined IOV (1rst step of prepare)
Implemented in dd4hep::cond::Manager_Type1.
|
inline |
Access to the data loader.
Definition at line 91 of file ConditionsManagerObject.h.
void ConditionsManagerObject::onRegister | ( | Condition | condition | ) |
Listener invocation when a condition is registered to the cache.
Call this when a condition is registered to the cache.
Definition at line 82 of file ConditionsManager.cpp.
void ConditionsManagerObject::onRemove | ( | Condition | condition | ) |
Listener invocation when a condition is deregistered from the cache.
Call this when a condition is deregistered from the cache.
Definition at line 88 of file ConditionsManager.cpp.
|
pure virtual |
Prepare all updates to the clients with the defined IOV.
Implemented in dd4hep::cond::Manager_Type1.
|
pure virtual |
Push all pending updates to the conditions store.
Note: This does not yet make the new conditions availible to the clients
Implemented in dd4hep::cond::Manager_Type1.
|
protected |
Register callback listener object.
Definition at line 62 of file ConditionsManager.cpp.
|
pure virtual |
Register IOV with type and key (much more performant...)
Implemented in dd4hep::cond::Manager_Type1.
ConditionsPool * ConditionsManagerObject::registerIOV | ( | const std::string & | data | ) |
Register IOV using new string data.
Definition at line 143 of file ConditionsManager.cpp.
|
pure virtual |
Register new IOV type if it does not (yet) exist.
Returns (false,pointer) if IOV existed and (true,pointer) if new IOV was registered to the manager.
Implemented in dd4hep::cond::Manager_Type1.
|
pure virtual |
Register new condition with the conditions store. Unlocked version, not multi-threaded.
Implemented in dd4hep::cond::Manager_Type1.
|
protected |
Reference to main detector description object.
Definition at line 64 of file ConditionsManagerObject.h.
|
protected |
Property: Flag to indicate if items should be loaded (or not)
Definition at line 72 of file ConditionsManagerObject.h.
|
protected |
Property: Flag to indicate if unloaded items should be saved to the slice (or not)
Definition at line 74 of file ConditionsManagerObject.h.
|
protected |
Reference to the data loader userd by this instance.
Definition at line 70 of file ConditionsManagerObject.h.
|
protected |
Conditions listeners on registration of new conditions.
Definition at line 66 of file ConditionsManagerObject.h.
|
protected |
Conditions listeners on de-registration of new conditions.
Definition at line 68 of file ConditionsManagerObject.h.