The Gaudi Framework  master (ff829712)
Loading...
Searching...
No Matches
DataHandleHolderBase< BASE > Class Template Reference

#include </builds/gaudi/Gaudi/GaudiKernel/include/GaudiKernel/DataHandleHolderBase.h>

Inheritance diagram for DataHandleHolderBase< BASE >:
Collaboration diagram for DataHandleHolderBase< BASE >:

Public Member Functions

std::vector< Gaudi::DataHandle * > inputHandles () const override
 
std::vector< Gaudi::DataHandle * > outputHandles () const override
 
virtual const DataObjIDCollextraInputDeps () const override
 
virtual const DataObjIDCollextraOutputDeps () const override
 
void declare (Gaudi::DataHandle &handle) override
 
void renounce (Gaudi::DataHandle &handle) override
 
bool renounceInput (const DataObjID &id) override
 
const DataObjIDCollinputDataObjs () const override
 
const DataObjIDColloutputDataObjs () const override
 
void addDependency (const DataObjID &id, const Gaudi::DataHandle::Mode &mode) override
 
- Public Member Functions inherited from extends< BASE, IDataHandleHolder >
void const * i_cast (const InterfaceID &tid) const override
 Implementation of IInterface::i_cast.
 
StatusCode queryInterface (const InterfaceID &ti, void **pp) override
 Implementation of IInterface::queryInterface.
 
std::vector< std::string > getInterfaceNames () const override
 Implementation of IInterface::getInterfaceNames.
 

Protected Member Functions

void initDataHandleHolder ()
 initializes all handles - called by the sysInitialize method of any descendant of this
 

Protected Attributes

DataObjIDColl m_inputDataObjs
 
DataObjIDColl m_outputDataObjs
 

Private Attributes

std::unordered_set< Gaudi::DataHandle * > m_handles
 
Gaudi::Property< DataObjIDCollm_extInputDataObjs { this, "ExtraInputs", DataObjIDColl{} }
 
Gaudi::Property< DataObjIDCollm_extOutputDataObjs { this, "ExtraOutputs", DataObjIDColl{} }
 

Additional Inherited Members

- Public Types inherited from extends< BASE, IDataHandleHolder >
using base_class
 Typedef to this class.
 
using extend_interfaces_base
 Typedef to the base of this class.
 
- Public Types inherited from extend_interfaces< Interfaces... >
using ext_iids
 take union of the ext_iids of all Interfaces...
 

Detailed Description

template<class BASE>
class DataHandleHolderBase< BASE >

Definition at line 33 of file DataHandleHolderBase.h.

Member Function Documentation

◆ addDependency()

template<class BASE>
void DataHandleHolderBase< BASE >::addDependency ( const DataObjID & id,
const Gaudi::DataHandle::Mode & mode )
inlineoverride

Definition at line 85 of file DataHandleHolderBase.h.

◆ declare()

template<class BASE>
void DataHandleHolderBase< BASE >::declare ( Gaudi::DataHandle & handle)
inlineoverride

Definition at line 47 of file DataHandleHolderBase.h.

47 {
48 if ( !handle.owner() ) handle.setOwner( this );
49
50 if ( handle.owner() != this ) {
51 throw GaudiException( "Attempt to declare foreign handle with algorithm!", this->name(), StatusCode::FAILURE );
52 }
53
54 m_handles.insert( &handle );
55 }
std::unordered_set< Gaudi::DataHandle * > m_handles

◆ extraInputDeps()

template<class BASE>
virtual const DataObjIDColl & DataHandleHolderBase< BASE >::extraInputDeps ( ) const
inlineoverridevirtual

Definition at line 44 of file DataHandleHolderBase.h.

44{ return m_extInputDataObjs; }
Gaudi::Property< DataObjIDColl > m_extInputDataObjs

◆ extraOutputDeps()

template<class BASE>
virtual const DataObjIDColl & DataHandleHolderBase< BASE >::extraOutputDeps ( ) const
inlineoverridevirtual

Definition at line 45 of file DataHandleHolderBase.h.

45{ return m_extOutputDataObjs; }
Gaudi::Property< DataObjIDColl > m_extOutputDataObjs

◆ initDataHandleHolder()

template<class BASE>
void DataHandleHolderBase< BASE >::initDataHandleHolder ( )
inlineprotected

initializes all handles - called by the sysInitialize method of any descendant of this

Definition at line 93 of file DataHandleHolderBase.h.

93 {
94 for ( auto h : m_handles ) h->init();
95 }

◆ inputDataObjs()

template<class BASE>
const DataObjIDColl & DataHandleHolderBase< BASE >::inputDataObjs ( ) const
inlineoverride

Definition at line 82 of file DataHandleHolderBase.h.

82{ return m_inputDataObjs; }

◆ inputHandles()

template<class BASE>
std::vector< Gaudi::DataHandle * > DataHandleHolderBase< BASE >::inputHandles ( ) const
inlineoverride

Definition at line 37 of file DataHandleHolderBase.h.

37 {
39 }

◆ outputDataObjs()

template<class BASE>
const DataObjIDColl & DataHandleHolderBase< BASE >::outputDataObjs ( ) const
inlineoverride

Definition at line 83 of file DataHandleHolderBase.h.

83{ return m_outputDataObjs; }

◆ outputHandles()

template<class BASE>
std::vector< Gaudi::DataHandle * > DataHandleHolderBase< BASE >::outputHandles ( ) const
inlineoverride

Definition at line 40 of file DataHandleHolderBase.h.

40 {
42 }

◆ renounce()

template<class BASE>
void DataHandleHolderBase< BASE >::renounce ( Gaudi::DataHandle & handle)
inlineoverride

Definition at line 57 of file DataHandleHolderBase.h.

57 {
58 if ( handle.owner() != this ) {
59 throw GaudiException( "Attempt to renounce foreign handle with algorithm!", this->name(), StatusCode::FAILURE );
60 }
61 m_handles.erase( &handle );
62 }

◆ renounceInput()

template<class BASE>
bool DataHandleHolderBase< BASE >::renounceInput ( const DataObjID & id)
inlineoverride

Definition at line 64 of file DataHandleHolderBase.h.

64 {
65 bool renounced = false;
66 // TODO: C++20: use std::erase_if
67 for ( auto i = m_handles.begin(), last = m_handles.end(); i != last; ) {
68 if ( ( *i )->mode() == Gaudi::DataHandle::Reader && ( *i )->fullKey() == id ) {
69 i = m_handles.erase( i );
70 renounced = true;
71 } else {
72 ++i;
73 }
74 }
75 if ( auto elm = m_inputDataObjs.find( id ); elm != m_inputDataObjs.end() ) {
76 m_inputDataObjs.erase( elm );
77 renounced = true;
78 }
79 return renounced;
80 }

Member Data Documentation

◆ m_extInputDataObjs

template<class BASE>
Gaudi::Property<DataObjIDColl> DataHandleHolderBase< BASE >::m_extInputDataObjs { this, "ExtraInputs", DataObjIDColl{} }
private

Definition at line 102 of file DataHandleHolderBase.h.

102{ this, "ExtraInputs", DataObjIDColl{} };

◆ m_extOutputDataObjs

template<class BASE>
Gaudi::Property<DataObjIDColl> DataHandleHolderBase< BASE >::m_extOutputDataObjs { this, "ExtraOutputs", DataObjIDColl{} }
private

Definition at line 103 of file DataHandleHolderBase.h.

103{ this, "ExtraOutputs", DataObjIDColl{} };

◆ m_handles

template<class BASE>
std::unordered_set<Gaudi::DataHandle*> DataHandleHolderBase< BASE >::m_handles
private

Definition at line 100 of file DataHandleHolderBase.h.

◆ m_inputDataObjs

template<class BASE>
DataObjIDColl DataHandleHolderBase< BASE >::m_inputDataObjs
protected

Definition at line 97 of file DataHandleHolderBase.h.

◆ m_outputDataObjs

template<class BASE>
DataObjIDColl DataHandleHolderBase< BASE >::m_outputDataObjs
protected

Definition at line 97 of file DataHandleHolderBase.h.


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