ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
AthenaBaseComps
src
AthAlgStartVisitor.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2018 CERN for the benefit of the ATLAS collaboration
3
*/
4
/*
5
*/
6
// $Id$
13
14
15
#include "
AthenaBaseComps/AthAlgStartVisitor.h
"
16
#include "
StoreGate/VarHandleKey.h
"
17
#include "
StoreGate/exceptions.h
"
18
#include "GaudiKernel/IAlgorithm.h"
19
26
AthAlgStartVisitor::AthAlgStartVisitor
(INamedInterface *n) {
27
// only do recursive traversal if we are called from a real Algorithm
28
IAlgorithm* ia =
dynamic_cast<
IAlgorithm*
>
(n);
29
if
( ia ==
nullptr
) {
30
m_recursive
=
false
;
31
}
else
if
( ia->isSequence() ) {
32
m_recursive
=
false
;
33
m_ignore
=
true
;
34
}
35
}
36
37
42
void
AthAlgStartVisitor::visit
(
const
IDataHandleHolder* holder)
43
{
44
if
(
m_ignore
)
return
;
45
46
// Make sure we process a component only once.
47
if
(
m_seen
.insert (holder).second) {
48
49
// Check all input handles are initialised
50
for
(Gaudi::DataHandle*
h
: holder->inputHandles()) {
51
52
auto
vhk =
dynamic_cast<
SG::VarHandleKey
*
>
(
h
);
53
if
(!vhk)
throw
SG::ExcNullHandleKey
();
54
55
if
(!vhk->storeHandle().get() && !vhk->key().empty()) {
56
throw
SG::ExcUninitKey
(vhk->clid(), vhk->key(), vhk->storeHandle().name(), holder->name());
57
}
58
59
// Call start() on all read conditions handle keys.
60
if
(
h
->isCondition()) {
61
vhk->start().ignore();
62
}
63
}
64
65
// Check all output handles are initialised
66
for
(Gaudi::DataHandle*
h
: holder->outputHandles()) {
67
68
auto
vhk =
dynamic_cast<
SG::VarHandleKey
*
>
(
h
);
69
if
(!vhk)
throw
SG::ExcNullHandleKey
();
70
71
if
(!vhk->storeHandle().get() && !vhk->key().empty()) {
72
throw
SG::ExcUninitKey
(vhk->clid(), vhk->key(), vhk->storeHandle().name(), holder->name());
73
}
74
}
75
76
if
(
m_recursive
) {
77
holder->acceptDHVisitor (
this
);
78
}
79
}
80
}
AthAlgStartVisitor.h
exceptions.h
Exceptions that can be thrown from StoreGate.
VarHandleKey.h
A property holding a SG store/key/clid from which a VarHandle is made.
AthAlgStartVisitor::visit
virtual void visit(const IDataHandleHolder *holder) override
Visit a component and start() any read conditions handles.
Definition
AthAlgStartVisitor.cxx:42
AthAlgStartVisitor::m_recursive
bool m_recursive
Definition
AthAlgStartVisitor.h:55
AthAlgStartVisitor::AthAlgStartVisitor
AthAlgStartVisitor()=default
AthAlgStartVisitor::m_seen
std::unordered_set< const IDataHandleHolder * > m_seen
figure out where we're called from
Definition
AthAlgStartVisitor.h:54
AthAlgStartVisitor::m_ignore
bool m_ignore
process recursively (for Algs)
Definition
AthAlgStartVisitor.h:56
h
Header file for AthHistogramAlgorithm.
SG::ExcNullHandleKey
Exception — Attempt to dereference a Read/Write/UpdateHandle with a null key.
Definition
Control/StoreGate/StoreGate/exceptions.h:38
SG::ExcUninitKey
Exception — Tried to create a handle from an uninitialized key.
Definition
Control/StoreGate/StoreGate/exceptions.h:111
SG::VarHandleKey
A property holding a SG store/key/clid from which a VarHandle is made.
Definition
StoreGate/StoreGate/VarHandleKey.h:59
Generated on
for ATLAS Offline Software by
1.17.0