20 static const std::string s_unknown =
"<unknown>";
24 return iNamed ? iNamed->name() : s_unknown;
39 auto incPack =
m_incSvc->getIncidents( &ctx );
42 log <<
MSG::DEBUG <<
" Number of Incidents to process = " << incPack.size() <<
" Context= " << ctx <<
endmsg;
44 while ( !incPack.empty() ) {
45 for (
const auto& [inc, listeners] : incPack ) {
46 for (
const auto& l : listeners ) {
48 log <<
MSG::DEBUG <<
"Calling '" << getListenerName( l.iListener ) <<
"' for incident [" << inc->type() <<
"]"
54 l.iListener->handle( *inc );
56 error() <<
"Exception with tag=" << exc.
tag()
61 if ( l.rethrow ) {
throw exc; }
62 }
catch (
const std::exception& exc ) {
63 error() <<
"Standard std::exception is caught"
67 if ( l.rethrow ) {
throw exc; }
69 error() <<
"UNKNOWN Exception is caught handling incident" << inc->type() <<
endmsg;
70 if ( l.rethrow ) {
throw; }
74 incPack =
m_incSvc->getIncidents( &ctx );
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
#define DECLARE_COMPONENT(type)
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
const SmartIF< IMessageSvc > & msgSvc() const
The standard message service.
MSG::Level msgLevel() const
This class represents an entry point to all the event specific data.
Algorithm(std::string name, ISvcLocator *svcloc, std::string version=PACKAGE_VERSION)
Constructor.
StatusCode initialize() override
the default (empty) implementation of IStateful::initialize() method
const std::string & name() const override
The identifying name of the algorithm object.
SmartIF< IService > service(std::string_view name, const bool createIf=true, const bool quiet=false) const
Return a pointer to the service identified by name (or "type/name")
Define general base for Gaudi exception.
const char * what() const override
method from std::exception
virtual const std::string & tag() const
name tag for the exception, or exception type
The interface implemented by any class wanting to listen to Incidents.
The ISvcLocator is the interface implemented by the Service Factory in the Application Manager to loc...
SmartIF< IIncidentSvc > m_incSvc
StatusCode initialize() override
StatusCode execute(const EventContext &ctx) const override
IncidentProcAlg(const std::string &name, ISvcLocator *pSvcLocator)
Definition of the MsgStream class used to transmit messages.
Small smart pointer class with automatic reference counting for IInterface.
This class is used for returning status codes from appropriate routines.
constexpr static const auto SUCCESS