1 #ifndef GAUDIHIVE_DATAOBJECTHANDLE_H 2 #define GAUDIHIVE_DATAOBJECTHANDLE_H 11 #include <type_traits> 36 T*
get()
const {
return get( true ); }
47 bool exist()
const {
return get( false ) !=
nullptr; }
60 T*
get(
bool mustExist )
const;
77 template <class OWNER, class K, typename = typename std::enable_if<std::is_base_of<IProperty, OWNER>::value>
::type>
98 template <class OWNER, class K, typename = typename std::enable_if<std::is_base_of<IProperty, OWNER>::value>
::type>
114 template <
typename T>
118 auto dataObj =
fetch();
130 T* obj =
dynamic_cast<T*
>( dataObj );
136 " and is different from the one of the object in the store." );
149 return static_cast<T*
>( dataObj );
153 template <
typename T>
165 template <
typename T>
172 T* obj =
get( false );
181 return put(
new T{} );
Define general base for Gaudi exception.
GAUDI_API const std::string typeinfoName(const std::type_info &)
Get platform independent information about the class type.
virtual const std::string & objKey() const
bool isSuccess() const
Test for a status code of SUCCESS.
SmartIF< IDataProviderSvc > m_EDS
bool exist() const
Check the existence of the object in the transient store.
DataObjectReadHandle(const DataObjID &k, IDataHandleHolder *owner)
DataObjectHandle.h GaudiKernel/DataObjectHandle.h.
This class is used for returning status codes from appropriate routines.
T * put(T *object)
Register object in transient store.
IDataHandleHolder * m_owner
DataObjectWriteHandle(const DataObjID &k, IDataHandleHolder *owner)
DataObjectHandleBase GaudiKernel/DataObjectHandleBase.h.
DataObjectWriteHandle(OWNER *owner, std::string name, const K &key={}, std::string doc="")
Autodeclaring constructor with property name, mode, key and documentation.
DataObject * fetch() const
T * getIfExists() const
Bypass check of existence of object in transient store Only uses main location of the...
virtual StatusCode registerObject(const std::string &fullPath, DataObject *pObject)=0
Register object with the data store.
T * getOrCreate()
Get object from store or create a new one if it doesn't exist.
virtual IDataHandleHolder * owner() const
T * get() const
Retrieve object from transient data store.
DataObjectHandleBase(const DataObjID &k, Gaudi::DataHandle::Mode a, IDataHandleHolder *owner)
DataObjectReadHandle(OWNER *owner, std::string name, const K &key={}, std::string doc="")
Autodeclaring constructor with property name, mode, key and documentation.