![]() |
The Gaudi Framework
v30r4 (9b837755)
|
Base class to all new-style data handles. More...
#include <GaudiKernel/DataHandle.h>
Public Types | |
using | AccessMode = IDataHandleMetadata::AccessMode |
Public Member Functions | |
DataHandle (const DataHandle &)=delete | |
DataHandle & | operator= (const DataHandle &)=delete |
DataHandle (DataHandle &&)=default | |
DataHandle & | operator= (DataHandle &&)=delete |
AccessMode | access () const |
const DataObjID & | targetKey () const |
(Configurable) ID of the data being accessed via this handle More... | |
void | setTargetKey (const DataObjID &id) |
Change the ID of the target data. More... | |
virtual void | initialize (const IDataHandleHolder &owner)=0 |
Initialize the data handle. More... | |
bool | ownerSetupDone () const |
Truth that owner setup has been performed. More... | |
template<typename Owner , std::enable_if_t< std::is_base_of< IDataHandleHolder, Owner >::value > * = nullptr> | |
void | setOwner (Owner &owner) |
Setup the owner of this DataHandle. More... | |
Protected Member Functions | |
template<typename Owner , typename T = DataObjID, std::enable_if_t< std::is_base_of< IDataHandleHolder, Owner >::value > * = nullptr> | |
DataHandle (Owner &owner, const std::string &propertyName, T &&defaultID, const std::string &docString, const IDataHandleMetadata &metadata) | |
Handles are constructed like a Gaudi property (and effectively behave as one, which sets the associated data object identifier) More... | |
template<typename T = DataObjID> | |
DataHandle (const std::string &propertyName, T &&defaultID, const std::string &docString, const IDataHandleMetadata &metadata) | |
The above constructor is easier to use correctly, and therefore preferred. More... | |
Private Attributes | |
Gaudi::Property< DataHandleConfigurable > | m_property |
Configurable property associated with a DataHandle. More... | |
bool | m_ownerSetupDone |
Truth that owner setup has been performed. More... | |
Base class to all new-style data handles.
The purpose of this base class is to act as a middleman between user-facing data handle classes (which provide ways to access data in various whiteboards) and the framework (which needs to know about data dependencies and provide a way to configure them).
Definition at line 91 of file DataHandle.h.
using Gaudi::v2::DataHandle::AccessMode = IDataHandleMetadata::AccessMode |
Definition at line 115 of file DataHandle.h.
|
delete |
|
default |
|
inlineprotected |
Handles are constructed like a Gaudi property (and effectively behave as one, which sets the associated data object identifier)
Definition at line 175 of file DataHandle.h.
|
inlineexplicitprotected |
The above constructor is easier to use correctly, and therefore preferred.
But some legacy use cases may require setting a DataHandle's owner lazily after construction. In that case, this constructor must be used.
If you opt for this lazy construction method, then you must set the owner Alg or AlgTool before said owner's initialize() procedure has finished. See setOwnerImpl() for more information on this.
Definition at line 192 of file DataHandle.h.
|
inline |
Definition at line 116 of file DataHandle.h.
|
pure virtual |
Initialize the data handle.
This must be done by the owner once it has sysInitialized itself. It is the stage at which the handle performs deferred framework operations such as acquiring access to the data stores.
Implemented in Gaudi::EventDataHandle.
|
delete |
|
delete |
|
inline |
Truth that owner setup has been performed.
Subclasses of DataHandle which allow for lazy owner initialization are strongly encouraged to check if said initialization has been performed at the time where a DataHandle is used.
Definition at line 152 of file DataHandle.h.
|
inline |
Setup the owner of this DataHandle.
You should only perform this operation when you used the owner-less constructor. And you should only perform it only once. Failures to do so will be detected and result in a run-time error.
Definition at line 161 of file DataHandle.h.
|
inline |
Change the ID of the target data.
Definition at line 136 of file DataHandle.h.
|
inline |
(Configurable) ID of the data being accessed via this handle
The current proposal is to only support one ID per handle. If experiments need to read from multiple whiteboard keys (LHCb alternate paths) or to write an object that's accessible via multiple whiteboard keys (ATLAS), they would need to implement the underlying support on their own.
For LHCb alternate paths, this can be handled at the DataLoader level (try linking from alternate paths if original one is empty), or via good old DataOnDemand for the sequential case. See https://gitlab.cern.ch/gaudi/Gaudi/merge_requests/422 .
FIXME: For aliased writes, how would that work with the Scheduler?
Definition at line 133 of file DataHandle.h.
|
private |
Truth that owner setup has been performed.
Definition at line 203 of file DataHandle.h.
|
private |
Configurable property associated with a DataHandle.
Definition at line 200 of file DataHandle.h.