DD4hep  1.30.0
Detector Description Toolkit for High Energy Physics
Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
dd4hep::cond::ConditionsManagerObject Class Referenceabstract

Basic conditions manager implementation. More...

#include <ConditionsManagerObject.h>

Inheritance diagram for dd4hep::cond::ConditionsManagerObject:
dd4hep::NamedObject dd4hep::PropertyConfigurable dd4hep::PropertyInterface dd4hep::cond::Manager_Type1

Public Types

typedef Condition::key_type key_type
 
typedef std::pair< ConditionsListener *, void * > Listener
 
typedef std::set< ListenerListeners
 
typedef std::unique_ptr< ConditionsDataLoaderLoader
 
typedef ConditionsManager::Result Result
 

Public Member Functions

 ConditionsManagerObject (Detector &description)
 Default constructor. More...
 
virtual ~ConditionsManagerObject ()
 Default destructor. More...
 
DetectordetectorDescription () const
 Access to the detector description instance. More...
 
ConditionsDataLoaderloader () 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...
 
ConditionsPoolregisterIOV (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 IOVTypeiovType (size_t iov_type) const =0
 Access IOV by its type. More...
 
virtual const IOVTypeiovType (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 ConditionsPoolregisterIOV (const IOVType &typ, IOV::Key key)=0
 Register IOV with type and key (much more performant...) More...
 
virtual ConditionsIOVPooliovPool (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< UserPoolcreateUserPool (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...
 
NamedObjectoperator= (const NamedObject &c)=default
 Assignment operator. More...
 
NamedObjectoperator= (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 PropertyManagerproperties () override
 Access to the properties of the object. More...
 
virtual const PropertyManagerproperties () 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 Propertyproperty (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

Detectorm_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...
 

Detailed Description

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.

Author
M.Frank
Version
1.0

Definition at line 52 of file ConditionsManagerObject.h.

Member Typedef Documentation

◆ key_type

Definition at line 56 of file ConditionsManagerObject.h.

◆ Listener

Definition at line 57 of file ConditionsManagerObject.h.

◆ Listeners

Definition at line 58 of file ConditionsManagerObject.h.

◆ Loader

Definition at line 59 of file ConditionsManagerObject.h.

◆ Result

Definition at line 60 of file ConditionsManagerObject.h.

Constructor & Destructor Documentation

◆ ConditionsManagerObject()

ConditionsManagerObject::ConditionsManagerObject ( Detector description)

Default constructor.

Definition at line 47 of file ConditionsManager.cpp.

◆ ~ConditionsManagerObject()

ConditionsManagerObject::~ConditionsManagerObject ( )
virtual

Default destructor.

Definition at line 56 of file ConditionsManager.cpp.

Member Function Documentation

◆ adoptCleanup()

virtual void dd4hep::cond::ConditionsManagerObject::adoptCleanup ( ConditionsCleanup cleaner)
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.

◆ blockRegister()

virtual size_t dd4hep::cond::ConditionsManagerObject::blockRegister ( ConditionsPool pool,
const std::vector< Condition > &  cond 
) const
pure virtual

Register a whole block of conditions with identical IOV.

Implemented in dd4hep::cond::Manager_Type1.

◆ callOnRegister()

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.

◆ callOnRemove()

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.

◆ clean() [1/2]

virtual std::pair<int,int> dd4hep::cond::ConditionsManagerObject::clean ( const ConditionsCleanup cleaner)
pure virtual

Invoke cache cleanup with user defined policy.

Implemented in dd4hep::cond::Manager_Type1.

◆ clean() [2/2]

virtual int dd4hep::cond::ConditionsManagerObject::clean ( const IOVType typ,
int  max_age 
)
pure virtual

Clean conditions, which are above the age limit.

Returns
Number of conditions cleaned/removed from the IOV pool of the given type

Implemented in dd4hep::cond::Manager_Type1.

◆ clear()

virtual std::pair<int,int> dd4hep::cond::ConditionsManagerObject::clear ( )
pure virtual

Full cleanup of all managed conditions.

Returns
pair<Number of pools cleared, Number of conditions cleaned up and removed>

Implemented in dd4hep::cond::Manager_Type1.

◆ compute()

virtual Result dd4hep::cond::ConditionsManagerObject::compute ( const IOV required_validity,
ConditionsSlice slice,
ConditionUpdateUserContext ctxt = 0 
)
pure virtual

Compute all derived conditions with the defined IOV (2nd step of prepare)

Implemented in dd4hep::cond::Manager_Type1.

◆ createUserPool()

virtual std::unique_ptr<UserPool> dd4hep::cond::ConditionsManagerObject::createUserPool ( const IOVType iovT) const
pure virtual

Create empty user pool object.

Implemented in dd4hep::cond::Manager_Type1.

◆ detectorDescription()

Detector& dd4hep::cond::ConditionsManagerObject::detectorDescription ( ) const
inline

Access to the detector description instance.

Definition at line 88 of file ConditionsManagerObject.h.

◆ doLoadConditions()

bool dd4hep::cond::ConditionsManagerObject::doLoadConditions ( ) const
inline

Access to load flag.

Definition at line 94 of file ConditionsManagerObject.h.

◆ doOutputUnloaded()

bool dd4hep::cond::ConditionsManagerObject::doOutputUnloaded ( ) const
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.

◆ fromString()

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.

◆ initialize()

virtual void dd4hep::cond::ConditionsManagerObject::initialize ( )
pure virtual

Initialize the object after having set the properties.

Overloadable interface

Implemented in dd4hep::cond::Manager_Type1.

◆ iovPool()

virtual ConditionsIOVPool* dd4hep::cond::ConditionsManagerObject::iovPool ( const IOVType type) const
pure virtual

Access conditions multi IOV pool by iov type.

Implemented in dd4hep::cond::Manager_Type1.

◆ iovType() [1/2]

virtual const IOVType* dd4hep::cond::ConditionsManagerObject::iovType ( const std::string &  iov_name) const
pure virtual

Access IOV by its name.

Implemented in dd4hep::cond::Manager_Type1.

◆ iovType() [2/2]

virtual const IOVType* dd4hep::cond::ConditionsManagerObject::iovType ( size_t  iov_type) const
pure virtual

Access IOV by its type.

Implemented in dd4hep::cond::Manager_Type1.

◆ iovTypes()

virtual const std::vector<IOVType>& dd4hep::cond::ConditionsManagerObject::iovTypes ( ) const
pure virtual

Access IOV by its type.

Implemented in dd4hep::cond::Manager_Type1.

◆ iovTypesUsed()

const std::vector< const dd4hep::IOVType * > ConditionsManagerObject::iovTypesUsed ( ) const

Access the used/registered IOV types.

Definition at line 94 of file ConditionsManager.cpp.

◆ load()

virtual Result dd4hep::cond::ConditionsManagerObject::load ( const IOV required_validity,
ConditionsSlice slice,
ConditionUpdateUserContext ctxt = 0 
)
pure virtual

Load all updates to the clients with the defined IOV (1rst step of prepare)

Implemented in dd4hep::cond::Manager_Type1.

◆ loader()

ConditionsDataLoader* dd4hep::cond::ConditionsManagerObject::loader ( ) const
inline

Access to the data loader.

Definition at line 91 of file ConditionsManagerObject.h.

◆ onRegister()

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.

◆ onRemove()

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.

◆ prepare()

virtual Result dd4hep::cond::ConditionsManagerObject::prepare ( const IOV req_iov,
ConditionsSlice slice,
ConditionUpdateUserContext ctx = 0 
)
pure virtual

Prepare all updates to the clients with the defined IOV.

Implemented in dd4hep::cond::Manager_Type1.

◆ pushUpdates()

virtual void dd4hep::cond::ConditionsManagerObject::pushUpdates ( )
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.

◆ registerCallee()

void ConditionsManagerObject::registerCallee ( Listeners listeners,
const Listener callee,
bool  add 
)
protected

Register callback listener object.

Definition at line 62 of file ConditionsManager.cpp.

◆ registerIOV() [1/2]

virtual ConditionsPool* dd4hep::cond::ConditionsManagerObject::registerIOV ( const IOVType typ,
IOV::Key  key 
)
pure virtual

Register IOV with type and key (much more performant...)

Implemented in dd4hep::cond::Manager_Type1.

◆ registerIOV() [2/2]

ConditionsPool * ConditionsManagerObject::registerIOV ( const std::string &  data)

Register IOV using new string data.

Definition at line 143 of file ConditionsManager.cpp.

◆ registerIOVType()

virtual std::pair<bool, const IOVType*> dd4hep::cond::ConditionsManagerObject::registerIOVType ( size_t  iov_type,
const std::string &  iov_name 
)
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.

◆ registerUnlocked()

virtual bool dd4hep::cond::ConditionsManagerObject::registerUnlocked ( ConditionsPool pool,
Condition  cond 
)
pure virtual

Register new condition with the conditions store. Unlocked version, not multi-threaded.

Implemented in dd4hep::cond::Manager_Type1.

Member Data Documentation

◆ m_detDesc

Detector& dd4hep::cond::ConditionsManagerObject::m_detDesc
protected

Reference to main detector description object.

Definition at line 64 of file ConditionsManagerObject.h.

◆ m_doLoad

bool dd4hep::cond::ConditionsManagerObject::m_doLoad = true
protected

Property: Flag to indicate if items should be loaded (or not)

Definition at line 72 of file ConditionsManagerObject.h.

◆ m_doOutputUnloaded

bool dd4hep::cond::ConditionsManagerObject::m_doOutputUnloaded = false
protected

Property: Flag to indicate if unloaded items should be saved to the slice (or not)

Definition at line 74 of file ConditionsManagerObject.h.

◆ m_loader

Loader dd4hep::cond::ConditionsManagerObject::m_loader
protected

Reference to the data loader userd by this instance.

Definition at line 70 of file ConditionsManagerObject.h.

◆ m_onRegister

Listeners dd4hep::cond::ConditionsManagerObject::m_onRegister
protected

Conditions listeners on registration of new conditions.

Definition at line 66 of file ConditionsManagerObject.h.

◆ m_onRemove

Listeners dd4hep::cond::ConditionsManagerObject::m_onRemove
protected

Conditions listeners on de-registration of new conditions.

Definition at line 68 of file ConditionsManagerObject.h.


The documentation for this class was generated from the following files: