The Gaudi Framework  master (ff829712)
Loading...
Searching...
No Matches
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::string > m_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 30 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 ) {}
DataObjID const & m_target

Member Function Documentation

◆ holderNames()

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

Definition at line 35 of file DataHandleFinder.h.

35{ return m_holderNames; }
std::vector< std::string > 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}
virtual std::vector< Gaudi::DataHandle * > inputHandles() const =0
virtual const DataObjIDColl & inputDataObjs() const =0
virtual const DataObjIDColl & extraInputDeps() const =0
virtual const std::string & name() const =0
Retrieve the name of the instance.

Member Data Documentation

◆ m_holderNames

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

Definition at line 39 of file DataHandleFinder.h.

◆ m_target

DataObjID const& DataHandleFinder::m_target
private

Definition at line 38 of file DataHandleFinder.h.


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