ATLAS Offline Software
Public Types | Public Member Functions | Static Public Member Functions | Protected Member Functions | List of all members
CondCont< T > Class Template Reference

Hold mapping of ranges to condition objects. More...

#include <CondCont.h>

Collaboration diagram for CondCont< T >:

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...
 
CondContoperator= (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...
 

Detailed Description

template<typename T>
class CondCont< T >

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.

Member Typedef Documentation

◆ Base

template<typename T >
typedef CondContBaseInfo<T>::Base CondCont< T >::Base

Base class.

Definition at line 892 of file CondCont.h.

◆ CondContSet

template<typename T >
typedef Base::CondContSet CondCont< T >::CondContSet

Definition at line 894 of file CondCont.h.

◆ key_type

template<typename T >
typedef CondContBase::key_type CondCont< T >::key_type

Definition at line 899 of file CondCont.h.

◆ Payload

template<typename T >
typedef T CondCont< T >::Payload

Payload type held by this class.

Definition at line 897 of file CondCont.h.

Constructor & Destructor Documentation

◆ CondCont() [1/3]

template<typename T >
CondCont< T >::CondCont ( Athena::IRCUSvc rcusvc,
const DataObjID &  id,
SG::DataProxy proxy = nullptr,
size_t  capacity = 16 
)

Constructor.

Parameters
rcusvcRCU service instance.
idCLID+key for this object.
proxyDataProxy for this object.
capacityInitial capacity of the container.

◆ ~CondCont()

template<typename T >
virtual CondCont< T >::~CondCont ( )
virtual

Destructor.

◆ CondCont() [2/3]

template<typename T >
CondCont< T >::CondCont ( const CondCont< T > &  )
delete

No copying.

◆ CondCont() [3/3]

template<typename T >
CondCont< T >::CondCont ( Athena::IRCUSvc rcusvc,
CLID  clid,
const DataObjID &  id,
SG::DataProxy proxy,
std::shared_ptr< typename CondContSet::IPayloadDeleter >  payloadDeleter,
size_t  capacity 
)
protected

Internal constructor.

Parameters
rcusvcRCU service instance.
CLIDof the most-derived CondCont.
idCLID+key for this object.
proxyDataProxy for this object.
payloadDeleterObject for deleting payload objects.
capacityInitial capacity of the container.

Member Function Documentation

◆ cast()

template<typename T >
const void* CondCont< T >::cast ( CLID  clid,
const void *  ptr 
) const
protected

Do pointer conversion for the payload type.

Parameters
clidCLID for the desired pointer type.
ptrPointer of type T*.

Converts ptr from T* to a pointer to the type given by clid. Returns nullptr if the conversion is not possible.

◆ doCast()

template<typename T >
virtual const void* CondCont< T >::doCast ( CLID  clid,
const void *  ptr 
) const
overrideprotectedvirtual

Do pointer conversion for the payload type.

Parameters
clidCLID for the desired pointer type.
ptrPointer 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.

◆ find() [1/2]

template<typename T >
const T* CondCont< T >::find ( const EventIDBase &  t) const

Look up a conditions object for a given time.

Parameters
tIOV time to find.

Returns the found object, or nullptr.

This variant may be more convenient to call from python.

◆ find() [2/2]

template<typename T >
bool CondCont< T >::find ( const EventIDBase &  t,
T const *&  obj,
EventIDRange const **  r = nullptr 
) const

Look up a conditions object for a given time.

Parameters
tIOV time to find.
obj[out]Object found.
rIf non-null, copy validity range of the object here.

Returns true if the object was found; false otherwide.

◆ insert()

template<typename T >
StatusCode CondCont< T >::insert ( const EventIDRange &  r,
std::unique_ptr< T >  obj,
const EventContext &  ctx = Gaudi::Hive::currentContext() 
)

Insert a new conditions object.

Parameters
rRange of validity of this object.
objPointer to the object being inserted.
ctxEvent 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).

◆ operator=()

template<typename T >
CondCont& CondCont< T >::operator= ( const CondCont< T > &  )
delete

◆ registerBaseInit()

template<typename T >
static void CondCont< T >::registerBaseInit ( )
static

Helper to ensure that the inheritance information for this class gets initialized.


The documentation for this class was generated from the following file:
CONDCONT_DEF
#define CONDCONT_DEF(...)
Definition: CondCont.h:1413
CLID
uint32_t CLID
The Class ID type.
Definition: Event/xAOD/xAODCore/xAODCore/ClassID_traits.h:47
TYPE
#define TYPE(CODE, TYP, IOTYP)