ATLAS Offline Software
Loading...
Searching...
No Matches
AthAlgorithmDHUpdate.cxx
Go to the documentation of this file.
1/*
2 * Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration.
3 */
4// $Id$
11
12
15
16
17namespace AthenaBaseComps {
18
19
26 std::unique_ptr<IDataHandleVisitor> chain)
27 : m_linkedObjs (linkedObjs),
28 m_chain (std::move (chain))
29{
30}
31
32
40void AthAlgorithmDHUpdate::visit (const IDataHandleHolder* dhh)
41{
42 // Make a copy, as usually linkedObjs will be extraOutputDeps().
43 DataObjIDColl ex = dhh->extraOutputDeps();
44
45 // Process all output dependencies.
46 for (const Gaudi::DataHandle* h : dhh->outputHandles()) {
47 if (!h->objKey().empty())
48 handle (h->fullKey().clid(), h->objKey());
49 }
50
51 for (const DataObjID& dobj : ex) {
52 if (!dobj.key().empty())
53 handle (dobj.clid(), dobj.key());
54 }
55
56 for (const DataObjID& dobj : dhh->outputDataObjs()) {
57 if (!dobj.key().empty())
58 handle (dobj.clid(), dobj.key());
59 }
60
61 // If we put anything in linkedObjs, also add the contents
62 // of extraOutputDeps.
63 if (!m_linkedObjs.empty()) {
64 m_linkedObjs.insert (ex.begin(), ex.end());
65 }
66
67 // Call the next hook function, if any.
68 if (m_chain) {
69 m_chain->visit (dhh);
70 }
71}
72
73
81void AthAlgorithmDHUpdate::handle (CLID clid, const std::string& key)
82{
83 const SG::BaseInfoBase* bib = SG::BaseInfoBase::find (clid);
84 if (!bib) return;
85 for (CLID clid2 : bib->get_bases()) {
86 if (clid2 != clid) {
87 m_linkedObjs.emplace (clid2, key);
88 }
89 }
90}
91
92
93} // namespace AthenaBaseComps
Update output dependencies to include symlinks.
Provide an interface for finding inheritance information at run time.
uint32_t CLID
The Class ID type.
Header file for AthHistogramAlgorithm.
AthAlgorithmDHUpdate(DataObjIDColl &linkedObjs, std::unique_ptr< IDataHandleVisitor > chain)
Constructor.
DataObjIDColl & m_linkedObjs
Set of additional output dependencies represented by links.
void handle(CLID clid, const std::string &key)
Handle one output dependency.
virtual void visit(const IDataHandleHolder *dhh) override
Walk over the dependencies of an algorithm.
std::unique_ptr< IDataHandleVisitor > m_chain
Hook to call after this one.
The non-template portion of the BaseInfo implementation.
static const BaseInfoBase * find(CLID clid)
Find the BaseInfoBase instance for clid.
Definition BaseInfo.cxx:570
const std::vector< CLID > & get_bases() const
Return the class IDs of all known bases of T (that have class IDs).
Definition BaseInfo.cxx:304
STL namespace.