ATLAS Offline Software
|
Hold mapping of ranges to condition objects. More...
#include <CondCont.h>
Public Types | |
typedef CondContBaseInfo< T >::Base | Base |
Base class. More... | |
typedef Base::CondContSet | CondContSet |
typedef T | Payload |
Payload type held by this class. More... | |
typedef CondContBase::key_type | key_type |
Public Member Functions | |
CondCont (Athena::IRCUSvc &rcusvc, const DataObjID &id, SG::DataProxy *proxy=nullptr, size_t capacity=16) | |
Constructor. More... | |
virtual | ~CondCont () |
Destructor. More... | |
CondCont (const CondCont &)=delete | |
No copying. More... | |
CondCont & | operator= (const CondCont &)=delete |
StatusCode | insert (const EventIDRange &r, std::unique_ptr< T > obj, const EventContext &ctx=Gaudi::Hive::currentContext()) |
Insert a new conditions object. More... | |
bool | find (const EventIDBase &t, T const *&obj, EventIDRange const **r=nullptr) const |
Look up a conditions object for a given time. More... | |
const T * | find (const EventIDBase &t) const |
Look up a conditions object for a given time. More... | |
Static Public Member Functions | |
static void | registerBaseInit () |
Helper to ensure that the inheritance information for this class gets initialized. More... | |
Protected Member Functions | |
CondCont (Athena::IRCUSvc &rcusvc, CLID clid, const DataObjID &id, SG::DataProxy *proxy, std::shared_ptr< typename CondContSet::IPayloadDeleter > payloadDeleter, size_t capacity) | |
Internal constructor. More... | |
const void * | cast (CLID clid, const void *ptr) const |
Do pointer conversion for the payload type. More... | |
virtual const void * | doCast (CLID clid, const void *ptr) const override |
Do pointer conversion for the payload type. More... | |
Hold mapping of ranges to condition objects.
This object holds mappings from a set of IOV ranges (represented as EventIDRange) to conditions objects (which are owned by this object). It has methods to insert a new mapping and to retrieve objects by IOV time.
This object is recorded in the conditions store, so it must have a CLID (the CondCont
object, not T
). This CLID should be declared using the CONDCONT_DEF
macro:
It is possible for one conditions object to derive from another. If TYPE
derives from BASE
, then declare this with a third argument to CONDCONT_DEF:
before any references to CondCont<TYPE>
. This is implemented by having CondCont<TYPE>
derive from CondCont<BASE>
. In that case, the mappings will be stored only in the most-derived class.
Definition at line 811 of file CondCont.h.
typedef CondContBaseInfo<T>::Base CondCont< T >::Base |
Base class.
Definition at line 892 of file CondCont.h.
typedef Base::CondContSet CondCont< T >::CondContSet |
Definition at line 894 of file CondCont.h.
typedef CondContBase::key_type CondCont< T >::key_type |
Definition at line 899 of file CondCont.h.
Payload type held by this class.
Definition at line 897 of file CondCont.h.
CondCont< T >::CondCont | ( | Athena::IRCUSvc & | rcusvc, |
const DataObjID & | id, | ||
SG::DataProxy * | proxy = nullptr , |
||
size_t | capacity = 16 |
||
) |
|
protected |
|
protected |
Do pointer conversion for the payload type.
clid | CLID for the desired pointer type. |
ptr | Pointer of type T* . |
Converts ptr
from T*
to a pointer to the type given by clid
. Returns nullptr if the conversion is not possible.
|
overrideprotectedvirtual |
Do pointer conversion for the payload type.
clid | CLID for the desired pointer type. |
ptr | Pointer of type T* . |
Converts ptr
from T*
to a pointer to the type given by clid
. Returns nullptr if the conversion is not possible.
This is a virtual function that calls cast
from the most-derived class of the hierarchy.
Look up a conditions object for a given time.
t | IOV time to find. |
Returns the found object, or nullptr.
This variant may be more convenient to call from python.
bool CondCont< T >::find | ( | const EventIDBase & | t, |
T const *& | obj, | ||
EventIDRange const ** | r = nullptr |
||
) | const |
Look up a conditions object for a given time.
t | IOV time to find. |
obj[out] | Object found. |
r | If non-null, copy validity range of the object here. |
Returns true if the object was found; false otherwide.
StatusCode CondCont< T >::insert | ( | const EventIDRange & | r, |
std::unique_ptr< T > | obj, | ||
const EventContext & | ctx = Gaudi::Hive::currentContext() |
||
) |
Insert a new conditions object.
r | Range of validity of this object. |
obj | Pointer to the object being inserted. |
ctx | Event context for the current thread. |
obj
must point to an object of type T
. This will give an error if this is not called on the most-derived CondCont
.
Returns SUCCESS if the object was successfully inserted; EXTENDED if the last existing range in the container was extended to match the new range; OVERLAP if the object was inserted but the range partially overlaps with an existing one; DUPLICATE if the object wasn't inserted because the range duplicates an existing one, and FAILURE otherwise (ownership of the object will be taken in any case).
|
static |
Helper to ensure that the inheritance information for this class gets initialized.