 |
ATLAS Offline Software
|
Go to the documentation of this file.
7 #ifndef ATHENAKERNEL_STORABLECONVERSIONS_H
8 # define ATHENAKERNEL_STORABLECONVERSIONS_H
17 #include "GaudiKernel/DataObject.h"
20 #include <type_traits>
33 IRegisterTransient* irt = 0,
39 bool isConst =
true) {
59 const std::type_info* tinfo =
nullptr,
79 const std::type_info* tinfo =
nullptr,
128 template <
class T,
class U >
129 struct DataBucketTrait
135 static constexpr
bool has_base = std::is_same_v<base1, SG::NoBase>;
138 using deflt = std::type_identity<SG::DataBucket<U> >;
152 template <
typename T>
155 return new bucket_t (pObject);
158 template <
typename T>
162 return new bucket_t (std::move(pObject));
168 template <
typename T>
179 quiet, irt, isConst));
180 return pTrans !=
nullptr;
185 #endif // ATHENAKERNEL_STORABLECONVERSIONS_H
Interface for registering a transient object in t2p map.
std::type_identity< SG::DataBucket< U > > deflt
static void init()
Initialization hook. A no-op by default.
bool fromStorable(DataObject *pDObj, T *&pTrans, bool quiet=false, IRegisterTransient *irt=0, bool isConst=true)
DataObject * asStorable(SG::DataObjectSharedPtr< T > pObject)
a traits class that associates a CLID to a type T It also detects whether T inherits from Gaudi DataO...
typename SG::BaseType< T >::type BaseType_t
Default, invalid implementation of ClassID_traits.
uint32_t CLID
The Class ID type.
T * Storable_cast(DataObject *pDObj, bool quiet=true, IRegisterTransient *irt=0, bool isConst=true)
SG::BaseType_t< typename SG::Bases< ConstDataVector< CaloCellContainer > >::bases::Base1 > base1
static constexpr bool has_base
Metafunction to find the proper DataBucket class for T.
typename std::conditional_t< has_base, deflt, recurse >::type type