ATLAS Offline Software
Loading...
Searching...
No Matches
AnaReentrantAlgorithmWrapper.cxx
Go to the documentation of this file.
1/*
2 Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
3*/
4
6
7
8
9//
10// includes
11//
12
14
17
18
19
20//
21// method implementations
22//
23
24namespace EL
25{
26 void AnaReentrantAlgorithmWrapper ::
27 testInvariant () const
28 {
29 RCU_INVARIANT (!m_config.name().empty());
30 }
31
32
33
34 AnaReentrantAlgorithmWrapper ::
35 AnaReentrantAlgorithmWrapper (AnaReentrantAlgorithmConfig val_config)
36 : m_config (std::move (val_config))
37 {
38 RCU_NEW_INVARIANT (this);
39 }
40
41
42
43 std::string_view AnaReentrantAlgorithmWrapper ::
44 getName () const
45 {
46 RCU_READ_INVARIANT (this);
47 return m_config.name();
48 }
49
50
51
52 bool AnaReentrantAlgorithmWrapper ::
53 hasName (const std::string& name) const
54 {
55 RCU_READ_INVARIANT (this);
56 return m_config.name() == name;
57 }
58
59
60
61 std::unique_ptr<IAlgorithmWrapper> AnaReentrantAlgorithmWrapper ::
62 makeClone() const
63 {
64 RCU_READ_INVARIANT (this);
65 return std::make_unique<AnaReentrantAlgorithmWrapper> (m_config);
66 }
67
68
69
70 StatusCode AnaReentrantAlgorithmWrapper ::
71 initialize (const AlgorithmWorkerData& workerData)
72 {
73 using namespace msgAlgorithmConfig;
75 if (m_config.makeAlgorithm (m_algorithm, workerData).isFailure())
76 {
77 ANA_MSG_ERROR ("failed to create AnaReentrantAlgorithm: " << m_config.name());
78 return StatusCode::FAILURE;
79 }
80 return StatusCode::SUCCESS;
81 }
82
83
84
85 StatusCode AnaReentrantAlgorithmWrapper ::
86 execute (const EventContext& ctx)
87 {
88 using namespace msgAlgorithmConfig;
89 RCU_READ_INVARIANT (this);
90 if (m_algorithm->sysExecute(ctx).isFailure())
91 {
92 ANA_MSG_ERROR ("failed to call execute() on algorithm: " << m_config.name());
93 return StatusCode::FAILURE;
94 }
95 return StatusCode::SUCCESS;
96 }
97
98
99
100 StatusCode AnaReentrantAlgorithmWrapper ::
101 finalize ()
102 {
103 using namespace msgAlgorithmConfig;
104 RCU_READ_INVARIANT (this);
105 if (m_algorithm->sysFinalize().isFailure())
106 {
107 ANA_MSG_ERROR ("failed to call finalize() on algorithm: " << m_config.name());
108 return StatusCode::FAILURE;
109 }
110 return StatusCode::SUCCESS;
111 }
112
113
114
115 StatusCode AnaReentrantAlgorithmWrapper ::
116 fileExecute ()
117 {
118 // no-op
119 return StatusCode::SUCCESS;
120 }
121
122
123
124 StatusCode AnaReentrantAlgorithmWrapper ::
125 beginInputFile ()
126 {
127 // no-op
128 return StatusCode::SUCCESS;
129 }
130
131
132
133 ::StatusCode AnaReentrantAlgorithmWrapper ::
134 endInputFile ()
135 {
136 // no-op
137 return StatusCode::SUCCESS;
138 }
139}
#define RCU_INVARIANT(x)
Definition Assert.h:196
#define RCU_CHANGE_INVARIANT(x)
Definition Assert.h:226
#define RCU_NEW_INVARIANT(x)
Definition Assert.h:228
#define RCU_READ_INVARIANT(x)
Definition Assert.h:224
#define ANA_MSG_ERROR(xmsg)
Macro printing error messages.
an object that can create a AnaReentrantAlgorithm
std::unique_ptr< AnaReentrantAlgorithm > m_algorithm
the actual algorithm (once instantiated)
AnaReentrantAlgorithmConfig m_config
the algorithm configuration
This module defines the arguments passed from the BATCH driver to the BATCH worker.
::StatusCode StatusCode
StatusCode definition for legacy code.
STL namespace.
all the external components an algorithm needs before initialization (in EventLoop)