The Gaudi Framework  master (37c0b60a)
DataHandleFinder Class Reference

#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 31 of file DataHandleFinder.h.

Constructor & Destructor Documentation

◆ DataHandleFinder()

DataHandleFinder::DataHandleFinder ( DataObjID const &  target)

Definition at line 13 of file DataHandleFinder.cpp.

13 : m_target( target ) {}

Member Function Documentation

◆ holderNames()

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

Definition at line 36 of file DataHandleFinder.h.

36 { return m_holderNames; }

◆ visit()

void DataHandleFinder::visit ( const IDataHandleHolder visitee)
overridevirtual

Implements IDataHandleVisitor.

Definition at line 15 of file DataHandleFinder.cpp.

15  {
16  if ( !visitee ) { return; }
17 
18  // See if the handle holder we're visiting contains the target
19  for ( auto& handle : visitee->inputHandles() ) {
20  if ( handle->fullKey() == m_target ) {
21  m_holderNames.push_back( visitee->name() );
22  return;
23  }
24  }
25 
26  for ( auto& handle : visitee->extraInputDeps() ) {
27  if ( handle == m_target ) {
28  m_holderNames.push_back( visitee->name() );
29  return;
30  }
31  }
32 
33  for ( auto& handle : visitee->inputDataObjs() ) {
34  if ( handle == m_target ) {
35  m_holderNames.push_back( visitee->name() );
36  return;
37  }
38  }
39 }

Member Data Documentation

◆ m_holderNames

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

Definition at line 40 of file DataHandleFinder.h.

◆ m_target

DataObjID const& DataHandleFinder::m_target
private

Definition at line 39 of file DataHandleFinder.h.


The documentation for this class was generated from the following files:
IDataHandleHolder::extraInputDeps
virtual const DataObjIDColl & extraInputDeps() const =0
DataHandleFinder::m_target
DataObjID const & m_target
Definition: DataHandleFinder.h:39
INamedInterface::name
virtual const std::string & name() const =0
Retrieve the name of the instance.
IDataHandleHolder::inputDataObjs
virtual const DataObjIDColl & inputDataObjs() const =0
std::vector::push_back
T push_back(T... args)
compareOutputFiles.target
target
Definition: compareOutputFiles.py:489
IDataHandleHolder::inputHandles
virtual std::vector< Gaudi::DataHandle * > inputHandles() const =0
DataHandleFinder::m_holderNames
std::vector< std::string > m_holderNames
Definition: DataHandleFinder.h:40