ATLAS Offline Software
|
Allow converting MetaCont<T> to T. More...
#include <MetaContDataBucket.h>
Public Member Functions | |
virtual void * | cast (CLID clid, IRegisterTransient *irt=0, bool isConst=true) override |
Return the contents of the DataBucket , converted to type given by clid. More... | |
virtual void * | cast (const std::type_info &tinfo, IRegisterTransient *irt=0, bool isConst=true) override |
Return the contents of the DataBucket , converted to type given by std::type_info. More... | |
virtual void * | cast (CLID clid, const std::type_info &tinfo, SG::IRegisterTransient *irt=0, bool isConst=true) override |
Return the contents of the DataBucket , converted to type given by clid. More... | |
virtual const CLID & | clID () const override |
virtual void * | object () override |
virtual const std::type_info & | tinfo () const override |
Return the type_info for the stored object. More... | |
operator T* () | |
operator const T * () const | |
template<class T > | |
T * | cast (SG::IRegisterTransient *irt=0, bool isConst=true) |
Return the contents of the DataBucket , converted to type T. More... | |
virtual void | relinquish () override |
Give up ownership of the DataBucket contents. More... | |
virtual void | lock () override |
If the held object derives from ILockable , call lock() on it. More... | |
Static Public Member Functions | |
static const CLID & | classID () |
Protected Member Functions | |
T * | ptr () |
const T * | cptr () const |
void * | tryStaticConversion (CLID clid) |
Try a conversion using static SG_BASES information. More... | |
void * | tryStaticConversion (const std::type_info &tinfo) |
Try a conversion using static SG_BASES information. More... | |
Private Types | |
typedef std::pair< const CopyConversionBase *, void * > | ent_t |
Objects made by copy conversion. More... | |
typedef std::vector< ent_t > | vec_t |
Private Member Functions | |
const SourceID | getSID () const |
Return the metadata source id for the current event store. More... | |
Private Attributes | |
T * | m_ptr |
vec_t | m_cnvcopies |
Allow converting MetaCont<T> to T.
Metadata objects of type T are stored in MetaDataStore as MetaCont<T>. However, to allow using xAOD objects, we'd like to be able to reference a DataLink<T> pointing at this store. That means that the cast operation of the DataBucket for MetaCont<T> needs to be able to convert to a T as well as MetaCont<T>. We can arrange this using this custom DataBucket class, which overrides the cast() methods. The use of this class is enabled by specializing DataBucketTrait in MetaCont.h.
Definition at line 40 of file MetaContDataBucket.h.
|
privateinherited |
Objects made by copy conversion.
Definition at line 160 of file DataBucket.h.
|
privateinherited |
Definition at line 161 of file DataBucket.h.
|
overridevirtual |
Return the contents of the DataBucket
, converted to type given by clid.
Note that only derived->base conversions are allowed here.
clid | The class ID to which to convert. |
tinfo | The std::type_info of the type to which to convert. |
irt | To be called if we make a new instance. |
isConst | True if the object being converted is regarded as const. |
This allows the callee to choose whether to use clid or tinfo. Here we use clid.
Reimplemented from SG::DataBucket< T >.
|
overridevirtual |
Return the contents of the DataBucket
, converted to type given by clid.
Note that only derived->base conversions are allowed here.
clid | The class ID to which to convert. |
irt | To be called if we make a new instance. |
isConst | True if the object being converted is regarded as const. |
Reimplemented from SG::DataBucket< T >.
|
overridevirtual |
Return the contents of the DataBucket
, converted to type given by std::type_info.
Note that only derived->base conversions are allowed here.
clid | The std::type_info of the type to which to convert. |
irt | To be called if we make a new instance. |
isConst | True if the object being converted is regarded as const. |
Reimplemented from SG::DataBucket< T >.
|
inherited |
Return the contents of the DataBucket
, converted to type T.
Note that only derived->base conversions are allowed here. T must have a valid Class ID for this to work.
irt | To be called if we make a new instance. |
isConst | True if the object being converted is regarded as const. |
|
staticinherited |
|
overridevirtualinherited |
Reimplemented in SG::DVLDataBucket< T >, and SG::DVLDataBucket< DV >.
|
inlineprotectedinherited |
Definition at line 133 of file DataBucket.h.
|
private |
Return the metadata source id for the current event store.
Returns an empty string if there's no source ID set.
|
overridevirtualinherited |
If the held object derives from ILockable
, call lock()
on it.
Implements DataBucketBase.
|
inlineoverridevirtualinherited |
Implements DataBucketBase.
Definition at line 51 of file DataBucket.h.
|
inlineinherited |
Definition at line 74 of file DataBucket.h.
|
inlineinherited |
Definition at line 73 of file DataBucket.h.
|
inlineprotectedinherited |
Definition at line 132 of file DataBucket.h.
|
inlineoverridevirtualinherited |
Give up ownership of the DataBucket
contents.
This leaks the contents and it is useful mainly for error handling.
Implements DataBucketBase.
Definition at line 123 of file DataBucket.h.
|
inlineoverridevirtualinherited |
Return the type_info
for the stored object.
Implements DataBucketBase.
Reimplemented in SG::DVLDataBucket< T >, and SG::DVLDataBucket< DV >.
Definition at line 60 of file DataBucket.h.
|
protectedinherited |
Try a conversion using static SG_BASES information.
clid | The class ID to which to convert. |
This can all be unfolded at compile time, so is fast, but doesn't take into account SG_ADD_BASES.
|
protectedinherited |
Try a conversion using static SG_BASES information.
tinfo | The std::type_info of the type to which to convert. |
This can all be unfolded at compile time, so is fast, but doesn't take into account SG_ADD_BASES.
|
privateinherited |
Definition at line 162 of file DataBucket.h.
|
privateinherited |
Definition at line 157 of file DataBucket.h.