15#include "GaudiKernel/IAlgTool.h"
16#include "GaudiKernel/IDataHandleHolder.h"
17#include "GaudiKernel/Algorithm.h"
31 const IDataHandleHolder& holder)
33 for (
const Gaudi::DataHandle*
h : holder.inputHandles()) {
34 if (
h->fullKey() == contHandleKey) {
39 for (
const Gaudi::DataHandle*
h : holder.outputHandles()) {
40 if (
h->fullKey() == contHandleKey) {
58const IDataHandleHolder*
findParent (
const IDataHandleHolder*
h)
61 const IAlgTool* astool =
dynamic_cast<const IAlgTool*
> (
h);
62 if (!astool)
return h;
63 const IInterface* parent = astool->parent();
64 if (!parent)
return h;
65 auto pdh =
dynamic_cast<const IDataHandleHolder*
> (parent);
67 if (
dynamic_cast<const Gaudi::Algorithm*
> (parent))
return pdh;
82 :
public IDataHandleVisitor
90 WDHScan (
const DataObjID& contHandleKey,
const IDataHandleHolder* owner)
97 virtual void visit (
const IDataHandleHolder*
h)
override;
155 const DataObjID& contHandleKey)
164 const IDataHandleHolder* parent =
findParent (owner);
165 if (parent && parent != owner) {
167 parent->acceptDHVisitor (&
scan);
168 found =
scan.m_found;
173 owner->addDependency (contHandleKey, Gaudi::DataHandle::Reader);
Property holding a SG store/key/clid/attr name from which a WriteDecorHandle is made.
Header file for AthHistogramAlgorithm.
Helper to scan a tree of components to search for another handle key potentially conflicting with the...
virtual void visit(const IDataHandleHolder *h) override
Called for each component in the tree.
const DataObjID & m_contHandleKey
The key we're searching for.
const IDataHandleHolder * m_owner
Stop the search when we reach this component.
bool m_found
Did we find the key?
bool m_sawOwner
Have we reached m_owner yet?
WDHScan(const DataObjID &contHandleKey, const IDataHandleHolder *owner)
Constructor.
void scan(TDirectory *td=0, int depth=0)
void registerWriteDecorHandleKey(IDataHandleHolder *owner, const DataObjID &contHandleKey)
Optionally register read dependency of a WriteDecorHandleKey.
const IDataHandleHolder * findParent(const IDataHandleHolder *h)
Find the top-level Gaudi component for H.
bool handleInHolder(const DataObjID &contHandleKey, const IDataHandleHolder &holder)
Test to see if HOLDER has registered a handle key matching CONTHANDLEKEY, as either input or output.