The Gaudi Framework  v32r2 (46d42edc)
DataHandleFinder Class Reference

Implements the IDataHandleVisitor interface Class used to explore heirarchy of nested IDataHandleHolders. More...

#include <GaudiKernel/DataHandleFinder.h>

Inheritance diagram for DataHandleFinder:
Collaboration diagram for DataHandleFinder:

Public Member Functions

 DataHandleFinder (DataObjID const &target)
 
void visit (const IDataHandleHolder *visitee) override
 
std::vector< std::string > & holderNames ()
 
- Public Member Functions inherited from IDataHandleVisitor
virtual ~IDataHandleVisitor ()=default
 

Private Attributes

DataObjID const & m_target
 
std::vector< std::stringm_holderNames
 

Detailed Description

Implements the IDataHandleVisitor interface Class used to explore heirarchy of nested IDataHandleHolders.

  • Instantiated with a specific target data object to find
  • Descends heirarchy of tools, examining all data handles
  • Returns a vector of tool/algorithm names that own handles to the target data
Author
Ben Wynne

Definition at line 21 of file DataHandleFinder.h.

Constructor & Destructor Documentation

◆ DataHandleFinder()

DataHandleFinder::DataHandleFinder ( DataObjID const &  target)

Definition at line 3 of file DataHandleFinder.cpp.

3 : m_target( target ) {}
DataObjID const & m_target

Member Function Documentation

◆ holderNames()

std::vector<std::string>& DataHandleFinder::holderNames ( )
inline

Definition at line 26 of file DataHandleFinder.h.

26 { return m_holderNames; }
std::vector< std::string > m_holderNames

◆ visit()

void DataHandleFinder::visit ( const IDataHandleHolder visitee)
overridevirtual

Implements IDataHandleVisitor.

Definition at line 5 of file DataHandleFinder.cpp.

5  {
6  if ( !visitee ) { return; }
7 
8  // See if the handle holder we're visiting contains the target
9  for ( auto& handle : visitee->inputHandles() ) {
10  if ( handle->fullKey() == m_target ) {
11  m_holderNames.push_back( visitee->name() );
12  return;
13  }
14  }
15 
16  for ( auto& handle : visitee->extraInputDeps() ) {
17  if ( handle == m_target ) {
18  m_holderNames.push_back( visitee->name() );
19  return;
20  }
21  }
22 
23  for ( auto& handle : visitee->inputDataObjs() ) {
24  if ( handle == m_target ) {
25  m_holderNames.push_back( visitee->name() );
26  return;
27  }
28  }
29 }
virtual std::vector< Gaudi::DataHandle * > inputHandles() const =0
virtual const DataObjIDColl & inputDataObjs() const =0
virtual const std::string & name() const =0
Retrieve the name of the instance.
T push_back(T... args)
DataObjID const & m_target
std::vector< std::string > m_holderNames
virtual const DataObjIDColl & extraInputDeps() const =0

Member Data Documentation

◆ m_holderNames

std::vector<std::string> DataHandleFinder::m_holderNames
private

Definition at line 30 of file DataHandleFinder.h.

◆ m_target

DataObjID const& DataHandleFinder::m_target
private

Definition at line 29 of file DataHandleFinder.h.


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