The Gaudi Framework  v30r4 (9b837755)
Gaudi::EventDataHandle Class Reference

Base class to all DataHandles interacting with the transient event store. More...

#include <GaudiKernel/EventDataHandle.h>

Inheritance diagram for Gaudi::EventDataHandle:
Collaboration diagram for Gaudi::EventDataHandle:

Classes

class  Metadata
 DataHandle subclass metadata for event data handles. More...
 

Public Member Functions

void initialize (const IDataHandleHolder &owner) final override
 Initialize the data handle. More...
 
- Public Member Functions inherited from Gaudi::v2::DataHandle
 DataHandle (const DataHandle &)=delete
 
DataHandleoperator= (const DataHandle &)=delete
 
 DataHandle (DataHandle &&)=default
 
DataHandleoperator= (DataHandle &&)=delete
 
AccessMode access () const
 
const DataObjIDtargetKey () 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...
 
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 Types

using AccessMode = DataHandle::AccessMode
 

Protected Member Functions

template<typename Owner >
 EventDataHandle (Owner &owner, const std::string &propertyName, DataObjID &&defaultID, const std::string &docString, const Metadata &metadata)
 Handles are constructed like a Gaudi property (and effectively behave as one, which sets the associated data object identifier) More...
 
- Protected Member Functions inherited from Gaudi::v2::DataHandle
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...
 

Protected Attributes

IDataProviderSvcm_whiteBoard = nullptr
 Pointer to the whiteboard, set during initialize() More...
 

Static Protected Attributes

static const Metadata s_readHandleMetadata
 
static const Metadata s_writeHandleMetadata
 

Private Member Functions

void registerToOwner (IDataHandleHolder &owner)
 Register ourselves to the owner (algorithm or tool) More...
 

Additional Inherited Members

- Public Types inherited from Gaudi::v2::DataHandle
using AccessMode = IDataHandleMetadata::AccessMode
 

Detailed Description

Base class to all DataHandles interacting with the transient event store.

This is internal machinery which clients can safely ignore.

Definition at line 32 of file EventDataHandle.h.

Member Typedef Documentation

using Gaudi::EventDataHandle::AccessMode = DataHandle::AccessMode
protected

Definition at line 39 of file EventDataHandle.h.

Constructor & Destructor Documentation

template<typename Owner >
Gaudi::EventDataHandle::EventDataHandle ( Owner &  owner,
const std::string propertyName,
DataObjID &&  defaultID,
const std::string docString,
const Metadata metadata 
)
inlineprotected

Handles are constructed like a Gaudi property (and effectively behave as one, which sets the associated data object identifier)

Definition at line 65 of file EventDataHandle.h.

67  : DataHandle{owner, propertyName, std::move( defaultID ), docString, metadata}
68  {
69  registerToOwner( owner );
70  }
void registerToOwner(IDataHandleHolder &owner)
Register ourselves to the owner (algorithm or tool)
DataHandle(const DataHandle &)=delete
T move(T...args)

Member Function Documentation

void Gaudi::EventDataHandle::initialize ( const IDataHandleHolder owner)
finaloverridevirtual

Initialize the data handle.

Implements Gaudi::v2::DataHandle.

Definition at line 12 of file EventDataHandle.cpp.

13  {
14  auto whiteBoard = owner.eventSvc();
15  if ( !whiteBoard ) throw std::runtime_error( "Failed to access whiteboard" );
16  m_whiteBoard = whiteBoard.get();
17  }
virtual SmartIF< IDataProviderSvc > & eventSvc() const =0
Provide access to the whiteboard after initialization.
IDataProviderSvc * m_whiteBoard
Pointer to the whiteboard, set during initialize()
void Gaudi::EventDataHandle::registerToOwner ( IDataHandleHolder owner)
private

Register ourselves to the owner (algorithm or tool)

Definition at line 10 of file EventDataHandle.cpp.

10 { owner.registerDataHandle( *this ); }
virtual void registerDataHandle(Gaudi::v2::DataHandle &)=0
Register a data handle of this algorithm/tool.

Member Data Documentation

IDataProviderSvc* Gaudi::EventDataHandle::m_whiteBoard = nullptr
protected

Pointer to the whiteboard, set during initialize()

Definition at line 73 of file EventDataHandle.h.

const EventDataHandle::Metadata Gaudi::EventDataHandle::s_readHandleMetadata
staticprotected

Definition at line 59 of file EventDataHandle.h.

const EventDataHandle::Metadata Gaudi::EventDataHandle::s_writeHandleMetadata
staticprotected

Definition at line 60 of file EventDataHandle.h.


The documentation for this class was generated from the following files: