DataObjectHandle.h GaudiKernel/DataObjectHandle.h.
More...
#include </builds/gaudi/Gaudi/GaudiKernel/include/GaudiKernel/AlgTool.h>
|
T * | get () const |
| Retrieve object from transient data store. More...
|
|
T * | getIfExists () const |
| Bypass check of existence of object in transient store Only uses main location of the. More...
|
|
bool | exist () const |
| Check the existence of the object in the transient store. More...
|
|
T * | getOrCreate () const |
| Get object from store or create a new one if it doesn't exist. More...
|
|
T * | put (std::unique_ptr< T > object) const |
| Register object in transient store. More...
|
|
T * | put (T *object) const |
|
std::string | pythonRepr () const override |
|
| DataObjectHandleBase (DataObjID k, Gaudi::DataHandle::Mode a, IDataHandleHolder *owner) |
|
| DataObjectHandleBase (std::string k, Gaudi::DataHandle::Mode a, IDataHandleHolder *owner) |
|
| DataObjectHandleBase (const DataObjectHandleBase &)=delete |
|
| DataObjectHandleBase (DataObjectHandleBase &&) |
|
template<class OWNER , class K , typename = std::enable_if_t<std::is_base_of_v<IProperty, OWNER>>> |
| DataObjectHandleBase (OWNER *owner, Gaudi::DataHandle::Mode m, std::string name, K key={}, std::string doc="") |
| Autodeclaring constructor with property name, mode, key and documentation. More...
|
|
|
T * | get (bool mustExist) const |
| Try to retrieve from the transient store. More...
|
|
template<typename T>
class DataObjectHandle< T >
DataObjectHandle.h GaudiKernel/DataObjectHandle.h.
Templated Handle class for objects in the event store
Inheritance: DataHandle->DataObjectHandleBase->DataObjectHandle<T>
- Author
- Charles Leggett
- Date
- 2015-09-01
Definition at line 36 of file AlgTool.h.
◆ DataObjectHandleBase() [1/5]
template<typename T >
DataObjectHandleBase::DataObjectHandleBase |
|
delete |
◆ DataObjectHandleBase() [2/5]
template<typename T >
DataObjectHandleBase::DataObjectHandleBase |
Definition at line 43 of file DataObjectHandleBase.cpp.
30 , m_init( other.m_init )
31 , m_optional( other.m_optional ) {
32 m_owner->declare( *
this );
◆ DataObjectHandleBase() [3/5]
template<typename T >
DataObjectHandleBase::DataObjectHandleBase |
◆ DataObjectHandleBase() [4/5]
template<typename T >
template<class OWNER , class K , typename = std::enable_if_t<std::is_base_of_v<IProperty, OWNER>>>
DataObjectHandleBase::DataObjectHandleBase |
( |
class OWNER |
, |
|
|
class K |
, |
|
|
typename |
= std::enable_if_t<std::is_base_of_v<IProperty, OWNER>> |
|
) |
| |
|
inline |
Autodeclaring constructor with property name, mode, key and documentation.
- Note
- the use std::enable_if is required to avoid ambiguities
Definition at line 49 of file DataObjectHandleBase.h.
53 p->template setOwnerType<OWNER>();
◆ DataObjectHandleBase() [5/5]
template<typename T >
DataObjectHandleBase::DataObjectHandleBase |
◆ exist()
Check the existence of the object in the transient store.
Definition at line 128 of file DataObjectHandle.h.
128 {
return get(
false ) !=
nullptr; }
◆ get() [1/2]
template<typename ValueType >
Retrieve object from transient data store.
Definition at line 117 of file DataObjectHandle.h.
117 {
return get(
true ); }
◆ get() [2/2]
Try to retrieve from the transient store.
If the retrieval succeded and this is the first time we retrieve, perform a dynamic cast to the desired object. Then finally set the handle as Read. If this is not the first time we cast and the cast worked, just use the static cast: we do not need the checks of the dynamic cast for every access!
Definition at line 165 of file DataObjectHandle.h.
166 auto dataObj =
fetch();
169 throw GaudiException(
"Cannot retrieve \'" + objKey() +
"\' from transient store.",
175 return static_cast<T*
>( dataObj );
◆ getIfExists()
Bypass check of existence of object in transient store Only uses main location of the.
Definition at line 123 of file DataObjectHandle.h.
123 {
return get(
false ); }
◆ getOrCreate()
Get object from store or create a new one if it doesn't exist.
Definition at line 189 of file DataObjectHandle.h.
190 T* obj =
get(
false );
191 return obj ? obj :
put( std::make_unique<T>() );
◆ put() [1/2]
Register object in transient store.
Definition at line 180 of file DataObjectHandle.h.
182 StatusCode sc = m_EDS->registerObject( objKey(), objectp.get() );
183 if ( !sc.
isSuccess() ) {
throw GaudiException(
"Error in put of " + objKey(),
"DataObjectHandle<T>::put", sc ); }
184 return objectp.release();
◆ put() [2/2]
◆ pythonRepr()
◆ m_goodType
The documentation for this class was generated from the following files: