Allow converting MetaCont<T> to T.
More...
#include <MetaContDataBucket.h>
|
| virtual void * | cast (CLID clid, IRegisterTransient *irt=0, bool isConst=true) override |
| | Return the contents of the DataBucket, converted to type given by clid.
|
| 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.
|
| 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.
|
| 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.
|
| | 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.
|
| virtual void | relinquish () override |
| | Give up ownership of the DataBucket contents.
|
| virtual void | lock () override |
| | If the held object derives from ILockable, call lock() on it.
|
|
| const SourceID | getSID () const |
| | Return the metadata source id for the current event store.
|
template<class T>
class SG::MetaContDataBucket< T >
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 41 of file MetaContDataBucket.h.
◆ ent_t
Objects made by copy conversion.
Definition at line 158 of file DataBucket.h.
◆ vec_t
◆ cast() [1/4]
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.
- Parameters
-
| irt | To be called if we make a new instance. |
| isConst | True if the object being converted is regarded as const. |
◆ cast() [2/4]
Return the contents of the DataBucket, converted to type given by clid.
Note that only derived->base conversions are allowed here.
- Parameters
-
| 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 >.
◆ cast() [3/4]
Return the contents of the DataBucket, converted to type given by clid.
Note that only derived->base conversions are allowed here.
- Parameters
-
| 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 >.
◆ cast() [4/4]
Return the contents of the DataBucket, converted to type given by std::type_info.
Note that only derived->base conversions are allowed here.
- Parameters
-
| 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 >.
◆ classID()
◆ clID()
◆ cptr()
◆ getSID()
Return the metadata source id for the current event store.
Returns an empty string if there's no source ID set.
◆ lock()
◆ object()
template<class T>
|
|
inlineoverridevirtualinherited |
◆ operator const T *()
◆ operator T*()
◆ ptr()
◆ relinquish()
template<class T>
|
|
inlineoverridevirtualinherited |
◆ tinfo()
template<class T>
|
|
inlineoverridevirtualinherited |
◆ tryStaticConversion() [1/2]
Try a conversion using static SG_BASES information.
- Parameters
-
| 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.
◆ tryStaticConversion() [2/2]
template<class T>
| void * SG::DataBucket< T >::tryStaticConversion |
( |
const std::type_info & | tinfo | ) |
|
|
protectedinherited |
Try a conversion using static SG_BASES information.
- Parameters
-
| 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.
◆ m_cnvcopies
◆ m_ptr
The documentation for this class was generated from the following file: