The Gaudi Framework  v30r3 (a5ef0a68)
DHHVisitor Class Reference

#include <GaudiKernel/DataHandleHolderVisitor.h>

Inheritance diagram for DHHVisitor:
Collaboration diagram for DHHVisitor:

Public Member Functions

 DHHVisitor (DataObjIDColl &ido, DataObjIDColl &odo)
 
const DataObjIDCollignoredInpKeys () const
 
const DataObjIDCollignoredOutKeys () const
 
void visit (const IDataHandleHolder *visitee) override
 
- Public Member Functions inherited from IDataHandleVisitor
virtual ~IDataHandleVisitor ()=default
 

Private Attributes

DataObjIDCollm_ido
 
DataObjIDCollm_odo
 
DataObjIDColl m_ign_i
 
DataObjIDColl m_ign_o
 

Detailed Description

Definition at line 8 of file DataHandleHolderVisitor.h.

Constructor & Destructor Documentation

DHHVisitor::DHHVisitor ( DataObjIDColl ido,
DataObjIDColl odo 
)

Definition at line 14 of file DataHandleHolderVisitor.cpp.

14 : m_ido( ido ), m_odo( odo ) {}
DataObjIDColl & m_ido
DataObjIDColl & m_odo

Member Function Documentation

const DataObjIDColl& DHHVisitor::ignoredInpKeys ( ) const
inline

Definition at line 13 of file DataHandleHolderVisitor.h.

13 { return m_ign_i; }
DataObjIDColl m_ign_i
const DataObjIDColl& DHHVisitor::ignoredOutKeys ( ) const
inline

Definition at line 14 of file DataHandleHolderVisitor.h.

14 { return m_ign_o; }
DataObjIDColl m_ign_o
void DHHVisitor::visit ( const IDataHandleHolder visitee)
overridevirtual

Implements IDataHandleVisitor.

Definition at line 16 of file DataHandleHolderVisitor.cpp.

17 {
18  if ( !v ) {
19  return;
20  }
21 
22  // Loop over inputs and outputs of handles, extra dependiencies and objects to
23  // collect all of them.
24  // Handles and extra dependencies are those of a specific algorith or tool, while
25  // the collection of data objects also contains those of the tree of tools and
26  // algorithms below it.
27 
28  // Loop over input handles and output handles and store those with with non-empty keys
29  // in the container of input objects passed to us and the others in a container of those
30  // we ignore for debug purposes. To avoid multiple for loops, make some tuples and loop
31  // over those.
32  for ( auto& hs : {make_tuple( v->inputHandles(), std::ref( m_ido ), std::ref( m_ign_i ) ),
33  make_tuple( v->outputHandles(), std::ref( m_odo ), std::ref( m_ign_o ) )} ) {
34  for ( const auto& h : std::get<0>( hs ) ) {
35  if ( !h->objKey().empty() ) {
36  std::get<1>( hs ).emplace( h->fullKey() );
37  } else {
38  std::get<2>( hs ).emplace( h->fullKey() );
39  }
40  }
41  }
42 
43  // The containers of handles are a different type than the on of input deps and input
44  // objects, so we need another loop here.
45  // NOTE: perhaps a view from range v3 can be used to also avoid this second loop.
46  for ( auto& hs : {make_tuple( v->extraInputDeps(), std::ref( m_ido ), std::ref( m_ign_i ) ),
47  make_tuple( v->extraOutputDeps(), std::ref( m_odo ), std::ref( m_ign_o ) ),
48  make_tuple( v->inputDataObjs(), std::ref( m_ido ), std::ref( m_ign_i ) ),
49  make_tuple( v->outputDataObjs(), std::ref( m_odo ), std::ref( m_ign_o ) )} ) {
50  for ( const auto& h : std::get<0>( hs ) ) {
51  if ( !h.key().empty() ) {
52  std::get<1>( hs ).emplace( h );
53  } else {
54  std::get<2>( hs ).emplace( h );
55  }
56  }
57  }
58 }
DataObjIDColl m_ign_o
T make_tuple(T...args)
DataObjIDColl m_ign_i
DataObjIDColl & m_ido
T ref(T...args)
DataObjIDColl & m_odo

Member Data Documentation

DataObjIDColl& DHHVisitor::m_ido
private

Definition at line 19 of file DataHandleHolderVisitor.h.

DataObjIDColl DHHVisitor::m_ign_i
private

Definition at line 20 of file DataHandleHolderVisitor.h.

DataObjIDColl DHHVisitor::m_ign_o
private

Definition at line 20 of file DataHandleHolderVisitor.h.

DataObjIDColl & DHHVisitor::m_odo
private

Definition at line 19 of file DataHandleHolderVisitor.h.


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