ATLAS Offline Software
Loading...
Searching...
No Matches
AsgServiceWrapper.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 AsgServiceWrapper ::
25 testInvariant () const
26 {
27 RCU_INVARIANT (!m_config.name().empty());
28 }
29
30
31
32 AsgServiceWrapper ::
33 AsgServiceWrapper (asg::AsgServiceConfig val_config)
34 : m_config (std::move (val_config))
35 {
36 RCU_NEW_INVARIANT (this);
37 }
38
39
40
41 std::string_view AsgServiceWrapper ::
42 getName () const
43 {
44 RCU_READ_INVARIANT (this);
45 return m_config.name();
46 }
47
48
49
50 bool AsgServiceWrapper ::
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> AsgServiceWrapper ::
60 makeClone() const
61 {
62 RCU_READ_INVARIANT (this);
63 return std::make_unique<AsgServiceWrapper> (m_config);
64 }
65
66
67
68 StatusCode AsgServiceWrapper ::
69 initialize (const AlgorithmWorkerData& /*workerData*/)
70 {
71 using namespace msgEventLoop;
73 if (m_config.makeService (m_service).isFailure())
74 {
75 ANA_MSG_ERROR ("failed to create AsgService: " << m_config.name());
76 return StatusCode::FAILURE;
77 }
78 return StatusCode::SUCCESS;
79 }
80
81
82
83 StatusCode AsgServiceWrapper ::
84 execute ()
85 {
86 RCU_READ_INVARIANT (this);
87 return StatusCode::SUCCESS;
88 }
89
90
91
92 StatusCode AsgServiceWrapper ::
93 finalize ()
94 {
95 using namespace msgEventLoop;
96 RCU_READ_INVARIANT (this);
97 if (m_service->finalize().isFailure())
98 {
99 ANA_MSG_ERROR ("failed to call finalize() on service: " << m_config.name());
100 return StatusCode::FAILURE;
101 }
102 return StatusCode::SUCCESS;
103 }
104
105
106
107 StatusCode AsgServiceWrapper ::
108 fileExecute ()
109 {
110 RCU_READ_INVARIANT (this);
111 return StatusCode::SUCCESS;
112 }
113
114
115
116 StatusCode AsgServiceWrapper ::
117 beginInputFile ()
118 {
119 RCU_READ_INVARIANT (this);
120 return StatusCode::SUCCESS;
121 }
122
123
124
125 ::StatusCode AsgServiceWrapper ::
126 endInputFile ()
127 {
128 // no-op
129 return StatusCode::SUCCESS;
130 }
131}
#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.
asg::AsgServiceConfig m_config
the algorithm configuration
std::shared_ptr< asg::AsgService > m_service
the actual service (once instantiated)
an object that can create a AsgService
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)