ATLAS Offline Software
Loading...
Searching...
No Matches
AsgToolWrapper.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// method implementations
20//
21
22namespace EL
23{
24 void AsgToolWrapper ::
25 testInvariant () const
26 {
27 RCU_INVARIANT (!m_config.name().empty());
28 }
29
30
31
32 AsgToolWrapper ::
33 AsgToolWrapper (asg::AsgToolConfig val_config)
34 : m_config (std::move (val_config))
35 {
36 RCU_NEW_INVARIANT (this);
37 }
38
39
40
41 std::string_view AsgToolWrapper ::
42 getName () const
43 {
44 RCU_READ_INVARIANT (this);
45 return m_config.name();
46 }
47
48
49
50 bool AsgToolWrapper ::
51 hasName (const std::string& name) const
52 {
53 RCU_READ_INVARIANT (this);
54 return m_config.name() == name;
55 }
56
57
58
59 std::unique_ptr<IAlgorithmWrapper> AsgToolWrapper ::
60 makeClone() const
61 {
62 RCU_READ_INVARIANT (this);
63 return std::make_unique<AsgToolWrapper> (m_config);
64 }
65
66
67
68 StatusCode AsgToolWrapper ::
69 initialize (const AlgorithmWorkerData& /*workerData*/)
70 {
71 using namespace msgEventLoop;
73 if (m_config.makeTool (m_tool, m_cleanup).isFailure())
74 {
75 ANA_MSG_ERROR ("failed to create AsgTool: " << m_config.name());
76 return StatusCode::FAILURE;
77 }
78 return StatusCode::SUCCESS;
79 }
80
81
82
83 StatusCode AsgToolWrapper ::
84 execute ()
85 {
86 RCU_READ_INVARIANT (this);
87 return StatusCode::SUCCESS;
88 }
89
90
91
92 StatusCode AsgToolWrapper ::
93 finalize ()
94 {
95 RCU_READ_INVARIANT (this);
96 return StatusCode::SUCCESS;
97 }
98
99
100
101 StatusCode AsgToolWrapper ::
102 fileExecute ()
103 {
104 RCU_READ_INVARIANT (this);
105 return StatusCode::SUCCESS;
106 }
107
108
109
110 StatusCode AsgToolWrapper ::
111 beginInputFile ()
112 {
113 RCU_READ_INVARIANT (this);
114 return StatusCode::SUCCESS;
115 }
116
117
118
119 ::StatusCode AsgToolWrapper ::
120 endInputFile ()
121 {
122 // no-op
123 return StatusCode::SUCCESS;
124 }
125}
#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.
std::shared_ptr< void > m_cleanup
the cleanup pointer for this tool
ToolHandle< asg::AsgTool > m_tool
the actual tool (once instantiated)
asg::AsgToolConfig m_config
the algorithm configuration
an object that can create a AsgTool
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)