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
18
19
20
21//
22// method implementations
23//
24
25namespace EL
26{
27 void AnaReentrantAlgorithmWrapper ::
28 testInvariant () const
29 {
30 RCU_INVARIANT (!m_config.name().empty());
31 }
32
33
34
35 AnaReentrantAlgorithmWrapper ::
36 AnaReentrantAlgorithmWrapper (AnaReentrantAlgorithmConfig val_config)
37 : m_config (std::move (val_config))
38 {
39 RCU_NEW_INVARIANT (this);
40 }
41
42
43
44 std::string_view AnaReentrantAlgorithmWrapper ::
45 getName () const
46 {
47 RCU_READ_INVARIANT (this);
48 return m_config.name();
49 }
50
51
52
53 bool AnaReentrantAlgorithmWrapper ::
54 hasName (const std::string& name) const
55 {
56 RCU_READ_INVARIANT (this);
57 return m_config.name() == name;
58 }
59
60
61
62 std::unique_ptr<IAlgorithmWrapper> AnaReentrantAlgorithmWrapper ::
63 makeClone() const
64 {
65 RCU_READ_INVARIANT (this);
66 return std::make_unique<AnaReentrantAlgorithmWrapper> (m_config);
67 }
68
69
70
71 StatusCode AnaReentrantAlgorithmWrapper ::
72 initialize (const AlgorithmWorkerData& workerData)
73 {
74 using namespace msgAlgorithmConfig;
76 if (m_config.makeAlgorithm (m_algorithm, workerData).isFailure())
77 {
78 ANA_MSG_ERROR ("failed to create AnaReentrantAlgorithm: " << m_config.name());
79 return StatusCode::FAILURE;
80 }
81 return StatusCode::SUCCESS;
82 }
83
84
85
86 StatusCode AnaReentrantAlgorithmWrapper ::
87 execute ()
88 {
89 using namespace msgAlgorithmConfig;
90 RCU_READ_INVARIANT (this);
91 if (m_algorithm->sysExecute(Gaudi::Hive::currentContext()).isFailure())
92 {
93 ANA_MSG_ERROR ("failed to call execute() on algorithm: " << m_config.name());
94 return StatusCode::FAILURE;
95 }
96 return StatusCode::SUCCESS;
97 }
98
99
100
101 StatusCode AnaReentrantAlgorithmWrapper ::
102 finalize ()
103 {
104 using namespace msgAlgorithmConfig;
105 RCU_READ_INVARIANT (this);
106 if (m_algorithm->sysFinalize().isFailure())
107 {
108 ANA_MSG_ERROR ("failed to call finalize() on algorithm: " << m_config.name());
109 return StatusCode::FAILURE;
110 }
111 return StatusCode::SUCCESS;
112 }
113
114
115
116 StatusCode AnaReentrantAlgorithmWrapper ::
117 fileExecute ()
118 {
119 // no-op
120 return StatusCode::SUCCESS;
121 }
122
123
124
125 StatusCode AnaReentrantAlgorithmWrapper ::
126 beginInputFile ()
127 {
128 // no-op
129 return StatusCode::SUCCESS;
130 }
131
132
133
134 ::StatusCode AnaReentrantAlgorithmWrapper ::
135 endInputFile ()
136 {
137 // no-op
138 return StatusCode::SUCCESS;
139 }
140}
#define RCU_INVARIANT(x)
Definition Assert.h:201
#define RCU_CHANGE_INVARIANT(x)
Definition Assert.h:231
#define RCU_NEW_INVARIANT(x)
Definition Assert.h:233
#define RCU_READ_INVARIANT(x)
Definition Assert.h:229
#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)