|
ATLAS Offline Software
|
Go to the documentation of this file.
7 #ifndef ATHENAKERNEL_STORABLECONVERSIONS_H
8 # define ATHENAKERNEL_STORABLECONVERSIONS_H
20 #include "GaudiKernel/DataObject.h"
24 # include "GaudiKernel/MsgStream.h"
27 #include <type_traits>
28 #include "boost/mpl/identity.hpp"
29 #include "boost/mpl/eval_if.hpp"
31 #include <type_traits>
43 IRegisterTransient* irt = 0,
49 bool isConst =
true) {
67 IRegisterTransient* irt = 0,
83 IRegisterTransient* irt = 0,
131 template <
class T,
class U >
132 struct DataBucketTrait
141 typedef boost::mpl::identity<SG::DataBucket<U> >
deflt;
157 template <
typename T>
160 return new bucket_t (pObject);
163 template <
typename T>
167 return new bucket_t (std::move(pObject));
170 template <
typename T>
173 return new bucket_t (std::move(pObject));
179 template <
typename T>
196 gLog << MSG::WARNING <<
"null input pointer " <<
endmsg;
205 pTrans =
b->template cast<T_nc> (irt, isConst);
206 bool success = pTrans !=
nullptr;
209 if (!
quiet && !success) {
212 <<
"can't convert stored DataObject " << pDObj
215 <<
")\n Unless you are following a symlink,"
216 <<
" it probably means you have a duplicate "
217 <<
"CLID = " << pDObj->clID()
225 #endif // ATHENAKERNEL_STORABLECONVERSIONS_H
Interface for registering a transient object in t2p map.
static void init()
Initialization hook. A no-op by default.
singleton-like access to IMessageSvc via open function and helper
A non-templated base class for DataBucket, allows to access the transient object address as a void*.
boost::mpl::eval_if< has_base, deflt, recurse >::type type
bool fromStorable(DataObject *pDObj, T *&pTrans, bool quiet=false, IRegisterTransient *irt=0, bool isConst=true)
DataObject * asStorable(T *pObject)
IMessageSvc * getMessageSvc(bool quiet=false)
DataBucketTrait< base1, U > recurse
static const std::string & typeName()
the demangled type name of T
a traits class that associates a CLID to a type T It also detects whether T inherits from Gaudi DataO...
boost::mpl::identity< SG::DataBucket< U > > deflt
Smart pointer to manage DataObject reference counts.
uint32_t CLID
The Class ID type.
SG::BaseType< typename SG::Bases< T >::bases::Base1 >::type base1
T * Storable_cast(DataObject *pDObj, bool quiet=true, IRegisterTransient *irt=0, bool isConst=true)
std::is_same< base1, SG::NoBase >::type has_base
Smart pointer to manage DataObject reference counts.
Metafunction to find the proper DataBucket class for T.
Helper metafunction to get base class types.