ATLAS Offline Software
Toggle main menu visibility
Loading...
Searching...
No Matches
Control
AthenaServices
src
AthIncFirerAlg.cxx
Go to the documentation of this file.
1
/*
2
Copyright (C) 2002-2025 CERN for the benefit of the ATLAS collaboration
3
*/
4
5
#include "
AthIncFirerAlg.h
"
6
#include "GaudiKernel/Incident.h"
7
8
9
AthIncFirerAlg::AthIncFirerAlg
(
const
std::string& name, ISvcLocator* pSvcLocator) :
10
AthReentrantAlgorithm
(name, pSvcLocator),
11
m_incSvc
(
"IncidentSvc"
, name)
12
{}
13
14
15
StatusCode
AthIncFirerAlg::initialize
() {
16
ATH_CHECK
(
m_incSvc
.retrieve() );
17
18
if
(
m_incidents
.empty()) {
19
ATH_MSG_ERROR
(
"Need to have at least one incident defined!"
<<name());
20
return
StatusCode::FAILURE;
21
}
22
return
StatusCode::SUCCESS;
23
}
24
25
26
StatusCode
AthIncFirerAlg::execute
(
const
EventContext& ctx)
const
{
27
28
for
(
const
std::string& inc :
m_incidents
) {
29
ATH_MSG_VERBOSE
(
"Firing incident "
<< inc);
30
if
(
m_serial
) {
31
m_incSvc
->fireIncident(Incident(name(), inc, ctx));
32
}
33
else
{
34
m_incSvc
->fireIncident(std::make_unique<Incident>(name(), inc, ctx));
35
}
36
}
37
return
StatusCode::SUCCESS;
38
}
39
40
ATH_CHECK
#define ATH_CHECK
Evaluate an expression and check for errors.
Definition
AthCheckMacros.h:40
AthIncFirerAlg.h
ATH_MSG_ERROR
#define ATH_MSG_ERROR(x)
Definition
AthMsgStreamMacros.h:33
ATH_MSG_VERBOSE
#define ATH_MSG_VERBOSE(x)
Definition
AthMsgStreamMacros.h:28
AthIncFirerAlg::AthIncFirerAlg
AthIncFirerAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition
AthIncFirerAlg.cxx:9
AthIncFirerAlg::m_serial
Gaudi::Property< bool > m_serial
Definition
AthIncFirerAlg.h:31
AthIncFirerAlg::m_incidents
Gaudi::Property< std::vector< std::string > > m_incidents
Definition
AthIncFirerAlg.h:30
AthIncFirerAlg::m_incSvc
ServiceHandle< IIncidentSvc > m_incSvc
Definition
AthIncFirerAlg.h:33
AthIncFirerAlg::execute
virtual StatusCode execute(const EventContext &ctx) const override
Definition
AthIncFirerAlg.cxx:26
AthIncFirerAlg::initialize
virtual StatusCode initialize() override
Definition
AthIncFirerAlg.cxx:15
AthReentrantAlgorithm
An algorithm that can be simultaneously executed in multiple threads.
Definition
AthReentrantAlgorithm.h:74
Generated on
for ATLAS Offline Software by
1.17.0