The Gaudi Framework  master (ff829712)
Loading...
Searching...
No Matches
IncidentSvc Class Reference

Default implementation of the IIncidentSvc interface. More...

#include </builds/gaudi/Gaudi/GaudiCoreSvc/src/IncidentSvc/IncidentSvc.h>

Inheritance diagram for IncidentSvc:
Collaboration diagram for IncidentSvc:

Public Member Functions

StatusCode finalize () override
 
void addListener (IIncidentListener *lis, const std::string &type="", long priority=0, bool rethrow=false, bool singleShot=false) override
 
void removeListener (IIncidentListener *l, const std::string &type="") override
 
void fireIncident (const Incident &incident) override
 
void fireIncident (std::unique_ptr< Incident > incident) override
 
void getListeners (std::vector< IIncidentListener * > &lis, const std::string &type="") const override
 
 IncidentSvc (const std::string &name, ISvcLocator *svc)
 
 ~IncidentSvc () override
 
IIncidentSvc::IncidentPack getIncidents (const EventContext *ctx) override
 
- Public Member Functions inherited from extends< Service, IIncidentSvc >
void const * i_cast (const InterfaceID &tid) const override
 Implementation of IInterface::i_cast.
 
StatusCode queryInterface (const InterfaceID &ti, void **pp) override
 Implementation of IInterface::queryInterface.
 
std::vector< std::string > getInterfaceNames () const override
 Implementation of IInterface::getInterfaceNames.
 
- Public Member Functions inherited from Service
const std::string & name () const override
 Retrieve name of the service.
 
StatusCode configure () override
 
StatusCode initialize () override
 
StatusCode start () override
 
StatusCode stop () override
 
StatusCode finalize () override
 
StatusCode terminate () override
 
Gaudi::StateMachine::State FSMState () const override
 
Gaudi::StateMachine::State targetFSMState () const override
 
StatusCode reinitialize () override
 
StatusCode restart () override
 
StatusCode sysInitialize () override
 Initialize Service.
 
StatusCode sysStart () override
 Initialize Service.
 
StatusCode sysStop () override
 Initialize Service.
 
StatusCode sysFinalize () override
 Finalize Service.
 
StatusCode sysReinitialize () override
 Re-initialize the Service.
 
StatusCode sysRestart () override
 Re-initialize the Service.
 
 Service (std::string name, ISvcLocator *svcloc)
 Standard Constructor.
 
SmartIF< ISvcLocator > & serviceLocator () const override
 Retrieve pointer to service locator.
 
template<typename IFace = IService>
SmartIF< IFace > service (const std::string &name, bool createIf=true) const
 
template<class T>
Gaudi::Details::PropertyBasedeclareProperty (const std::string &name, ToolHandle< T > &hndl, const std::string &doc="none")
 
template<class T>
StatusCode declareTool (ToolHandle< T > &handle, bool createIf=true)
 
template<class T>
StatusCode declareTool (ToolHandle< T > &handle, const std::string &toolTypeAndName, bool createIf=true)
 Declare used tool.
 
template<class T>
Gaudi::Details::PropertyBasedeclareProperty (const std::string &name, ToolHandleArray< T > &hndlArr, const std::string &doc="none")
 
template<class T>
void addToolsArray (ToolHandleArray< T > &hndlArr)
 
const std::vector< IAlgTool * > & tools () const
 
SmartIF< IAuditorSvc > & auditorSvc () const
 The standard auditor service.May not be invoked before sysInitialize() has been invoked.
 
- Public Member Functions inherited from PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >
StatusCode setProperty (const Gaudi::Details::PropertyBase &p)
 Set the property from a property.
 
StatusCode setProperty (const std::string &name, const char *v)
 Special case for string literals.
 
StatusCode setProperty (const std::string &name, const std::string &v)
 Special case for std::string.
 
StatusCode setProperty (const std::string &name, const TYPE &value)
 set the property form the value
 
 PropertyHolder ()=default
 
Gaudi::Details::PropertyBasedeclareProperty (Gaudi::Details::PropertyBase &prop)
 Declare a property.
 
Gaudi::Details::PropertyBasedeclareProperty (const std::string &name, TYPE &value, const std::string &doc="none")
 Helper to wrap a regular data member and use it as a regular property.
 
Gaudi::Details::PropertyBasedeclareProperty (const std::string &name, Gaudi::Property< TYPE, VERIFIER, HANDLERS > &prop, const std::string &doc="none")
 Declare a PropertyBase instance setting name and documentation.
 
Gaudi::Details::PropertyBasedeclareRemoteProperty (const std::string &name, IProperty *rsvc, const std::string &rname="")
 Declare a remote property.
 
StatusCode setProperty (const std::string &name, const Gaudi::Details::PropertyBase &p) override
 set the property from another property with a different name
 
StatusCode setProperty (const std::string &s) override
 set the property from the formatted string
 
StatusCode setProperty (const Gaudi::Details::PropertyBase &p)
 Set the property from a property.
 
StatusCode setProperty (const std::string &name, const char *v)
 Special case for string literals.
 
StatusCode setProperty (const std::string &name, const std::string &v)
 Special case for std::string.
 
StatusCode setProperty (const std::string &name, const TYPE &value)
 set the property form the value
 
StatusCode setPropertyRepr (const std::string &n, const std::string &r) override
 set the property from name and value string representation
 
StatusCode getProperty (Gaudi::Details::PropertyBase *p) const override
 get the property
 
const Gaudi::Details::PropertyBasegetProperty (std::string_view name) const override
 get the property by name
 
StatusCode getProperty (std::string_view n, std::string &v) const override
 convert the property to the string
 
const std::vector< Gaudi::Details::PropertyBase * > & getProperties () const override
 get all properties
 
bool hasProperty (std::string_view name) const override
 Return true if we have a property with the given name.
 
Gaudi::Details::PropertyBaseproperty (std::string_view name) const
 \fixme property and bindPropertiesTo should be protected
 
void bindPropertiesTo (Gaudi::Interfaces::IOptionsSvc &optsSvc)
 
 PropertyHolder (const PropertyHolder &)=delete
 
PropertyHolderoperator= (const PropertyHolder &)=delete
 
- Public Member Functions inherited from CommonMessaging< implements< IService, IProperty, IStateful > >
MSG::Level msgLevel () const
 get the cached level (originally extracted from the embedded MsgStream)
 
bool msgLevel (MSG::Level lvl) const
 get the output level from the embedded MsgStream
 
- Public Member Functions inherited from CommonMessagingBase
virtual ~CommonMessagingBase ()=default
 Virtual destructor.
 
const SmartIF< IMessageSvc > & msgSvc () const
 The standard message service.
 
MsgStreammsgStream () const
 Return an uninitialized MsgStream.
 
MsgStreammsgStream (const MSG::Level level) const
 Predefined configurable message stream for the efficient printouts.
 
MsgStreamalways () const
 shortcut for the method msgStream(MSG::ALWAYS)
 
MsgStreamfatal () const
 shortcut for the method msgStream(MSG::FATAL)
 
MsgStreamerr () const
 shortcut for the method msgStream(MSG::ERROR)
 
MsgStreamerror () const
 shortcut for the method msgStream(MSG::ERROR)
 
MsgStreamwarning () const
 shortcut for the method msgStream(MSG::WARNING)
 
MsgStreaminfo () const
 shortcut for the method msgStream(MSG::INFO)
 
MsgStreamdebug () const
 shortcut for the method msgStream(MSG::DEBUG)
 
MsgStreamverbose () const
 shortcut for the method msgStream(MSG::VERBOSE)
 
MsgStreammsg () const
 shortcut for the method msgStream(MSG::INFO)
 

Private Types

typedef std::list< IIncidentSvc::ListenerListenerList
 
typedef GaudiUtils::HashMap< Gaudi::StringKey, std::unique_ptr< ListenerList > > ListenerMap
 
typedef tbb::concurrent_queue< std::unique_ptr< Incident > > IncQueue_t
 

Private Member Functions

ListenerMap::iterator removeListenerFromList (ListenerMap::iterator, IIncidentListener *item, bool scheduleRemoval)
 
void i_fireIncident (const Incident &incident, const std::string &type)
 Internal function to allow incidents listening to all events.
 

Private Attributes

ListenerMap m_listenerMap
 List of auditor names.
 
const std::string * m_currentIncidentType = nullptr
 Incident being fired.
 
std::recursive_mutex m_listenerMapMutex
 Mutex to synchronize access to m_listenerMap.
 
ChronoEntity m_timer
 timer & it's lock
 
bool m_timerLock = false
 
tbb::concurrent_unordered_map< EventContext::ContextID_t, IncQueue_tm_firedIncidents
 
tbb::concurrent_unordered_map< EventContext::ContextID_t, EventContext::ContextEvt_tm_slotEvent
 Event ID for each slot.
 

Additional Inherited Members

- Public Types inherited from extends< Service, IIncidentSvc >
using base_class
 Typedef to this class.
 
using extend_interfaces_base
 Typedef to the base of this class.
 
- Public Types inherited from Service
using Factory = Gaudi::PluginService::Factory<IService*( const std::string&, ISvcLocator* )>
 
- Public Types inherited from PropertyHolder< CommonMessaging< implements< IService, IProperty, IStateful > > >
using PropertyHolderImpl
 Typedef used to refer to this class from derived classes, as in.
 
- Public Types inherited from CommonMessaging< implements< IService, IProperty, IStateful > >
using base_class
 
- Public Types inherited from extend_interfaces< Interfaces... >
using ext_iids
 take union of the ext_iids of all Interfaces...
 
- Protected Member Functions inherited from Service
std::vector< IAlgTool * > & tools ()
 
 ~Service () override
 
int outputLevel () const
 get the Service's output level
 
- Protected Member Functions inherited from CommonMessaging< implements< IService, IProperty, IStateful > >
MSG::Level setUpMessaging () const
 Set up local caches.
 
MSG::Level resetMessaging ()
 Reinitialize internal states.
 
void updateMsgStreamOutputLevel (int level)
 Update the output level of the cached MsgStream.
 
- Protected Attributes inherited from Service
Gaudi::StateMachine::State m_state = Gaudi::StateMachine::OFFLINE
 Service state.
 
Gaudi::StateMachine::State m_targetState = Gaudi::StateMachine::OFFLINE
 Service state.
 
Gaudi::Property< int > m_outputLevel { this, "OutputLevel", MSG::NIL, "output level" }
 flag indicating whether ToolHandle tools have been added to m_tools
 
Gaudi::Property< bool > m_auditorInitialize { this, "AuditInitialize", false, "trigger auditor on initialize()" }
 
Gaudi::Property< bool > m_auditorStart { this, "AuditStart", false, "trigger auditor on start()" }
 
Gaudi::Property< bool > m_auditorStop { this, "AuditStop", false, "trigger auditor on stop()" }
 
Gaudi::Property< bool > m_auditorFinalize { this, "AuditFinalize", false, "trigger auditor on finalize()" }
 
Gaudi::Property< bool > m_auditorReinitialize { this, "AuditReinitialize", false, "trigger auditor on reinitialize()" }
 
Gaudi::Property< bool > m_auditorRestart { this, "AuditRestart", false, "trigger auditor on restart()" }
 
Gaudi::Property< bool > m_autoRetrieveTools
 
Gaudi::Property< bool > m_checkToolDeps
 
SmartIF< IAuditorSvcm_pAuditorSvc
 Auditor Service.
 

Detailed Description

Default implementation of the IIncidentSvc interface.

This implementation is thread-safe with the following features:

Definition at line 35 of file IncidentSvc.h.

Member Typedef Documentation

◆ IncQueue_t

typedef tbb::concurrent_queue<std::unique_ptr<Incident> > IncidentSvc::IncQueue_t
private

Definition at line 80 of file IncidentSvc.h.

◆ ListenerList

Definition at line 40 of file IncidentSvc.h.

◆ ListenerMap

Definition at line 41 of file IncidentSvc.h.

Constructor & Destructor Documentation

◆ IncidentSvc()

IncidentSvc::IncidentSvc ( const std::string & name,
ISvcLocator * svc )

Definition at line 39 of file IncidentSvc.cpp.

39: base_class( name, svc ) {}
const std::string & name() const override
Retrieve name of the service.
Definition Service.cpp:333

◆ ~IncidentSvc()

IncidentSvc::~IncidentSvc ( )
override

Definition at line 40 of file IncidentSvc.cpp.

40{ auto lock = std::scoped_lock{ m_listenerMapMutex }; }
std::recursive_mutex m_listenerMapMutex
Mutex to synchronize access to m_listenerMap.
Definition IncidentSvc.h:73

Member Function Documentation

◆ addListener()

void IncidentSvc::addListener ( IIncidentListener * lis,
const std::string & type = "",
long priority = 0,
bool rethrow = false,
bool singleShot = false )
override

Definition at line 50 of file IncidentSvc.cpp.

51 {
52 static const std::string all{ "ALL" };
53 auto lock = std::scoped_lock{ m_listenerMapMutex };
54
55 const std::string& ltype = ( !type.empty() ? type : all );
56
57 // find if the type already exists
58 auto itMap = m_listenerMap.find( ltype );
59 if ( itMap == m_listenerMap.end() ) {
60 // if not found, create and insert now a list of listeners
61 auto p = m_listenerMap.insert( { ltype, std::make_unique<ListenerList>() } );
62 if ( !p.second ) { /* OOPS */
63 }
64 itMap = p.first;
65 }
66 auto& llist = *itMap->second;
67 // add Listener ordered by priority -- higher priority first,
68 // and then add behind listeneres with the same priority
69 // -- so we skip over all items with higher or same priority
70 auto i = std::partition_point( std::begin( llist ), std::end( llist ),
71 [&]( const Listener& j ) { return j.priority >= prio; } );
72 // We insert before the current position
73 DEBMSG << "Adding [" << type << "] listener '" << getListenerName( lis ) << "' with priority " << prio << endmsg;
74 llist.emplace( i, IIncidentSvc::Listener{ lis, prio, rethrow, singleShot } );
75}
#define DEBMSG
MsgStream & endmsg(MsgStream &s)
MsgStream Modifier: endmsg. Calls the output method of the MsgStream.
Definition MsgStream.h:198
ListenerMap m_listenerMap
List of auditor names.
Definition IncidentSvc.h:66
all
decorate service
Definition decorators.py:53

◆ finalize()

StatusCode IncidentSvc::finalize ( )
override

Definition at line 41 of file IncidentSvc.cpp.

41 {
42 DEBMSG << m_timer.outputUserTime( "Incident timing: Mean(+-rms)/Min/Max:%3%(+-%4%)/%6%/%7%[ms] ", System::milliSec )
43 << m_timer.outputUserTime( "Total:%2%[s]", System::Sec ) << endmsg;
44
45 m_firedIncidents.clear();
46
47 // Finalize this specific service
48 return Service::finalize();
49}
tbb::concurrent_unordered_map< EventContext::ContextID_t, IncQueue_t > m_firedIncidents
Definition IncidentSvc.h:81
ChronoEntity m_timer
timer & it's lock
Definition IncidentSvc.h:76
StatusCode finalize() override
Definition Service.cpp:223
@ milliSec
Definition Timing.h:45
@ Sec
Definition Timing.h:45

◆ fireIncident() [1/2]

void IncidentSvc::fireIncident ( const Incident & incident)
override

Definition at line 185 of file IncidentSvc.cpp.

185 {
186
187 Gaudi::Utils::LockedChrono timer( m_timer, m_timerLock );
188
189 // Call specific listeners
190 i_fireIncident( incident, incident.type() );
191 // Try listeners registered for ALL incidents
192 if ( incident.type() != "ALL" ) { // avoid double calls if somebody fires the incident "ALL"
193 i_fireIncident( incident, "ALL" );
194 }
195}
const std::string & type() const
Access to the incident type.
Definition Incident.h:43
bool m_timerLock
Definition IncidentSvc.h:77
void i_fireIncident(const Incident &incident, const std::string &type)
Internal function to allow incidents listening to all events.

◆ fireIncident() [2/2]

void IncidentSvc::fireIncident ( std::unique_ptr< Incident > incident)
override

Definition at line 196 of file IncidentSvc.cpp.

196 {
197
198 const EventContext& ctx = incident->context();
199 DEBMSG << "Async incident '" << incident->type() << "' fired on context " << ctx << endmsg;
200
201 // create or get incident queue for slot
202 auto [incItr, inserted1] = m_firedIncidents.insert( { ctx.slot(), IncQueue_t() } );
203 // save or get current event for slot
204 auto [slotItr, inserted2] = m_slotEvent.insert( { ctx.slot(), ctx.evt() } );
205
206 // if new event in slot, clear all remaining old incidents
207 if ( slotItr->second != ctx.evt() ) {
208 slotItr->second = ctx.evt();
209
210 if ( msgLevel( MSG::DEBUG ) and !incItr->second.empty() ) {
211 debug() << "Clearing remaining obsolete incidents from slot " << ctx.slot() << ":";
212 std::unique_ptr<Incident> inc;
213 while ( incItr->second.try_pop( inc ) ) { debug() << " " << inc->type() << "(" << inc->context() << ")"; }
214 debug() << endmsg;
215 }
216 incItr->second.clear();
217 }
218 incItr->second.push( std::move( incident ) );
219}
MsgStream & debug() const
shortcut for the method msgStream(MSG::DEBUG)
tbb::concurrent_queue< std::unique_ptr< Incident > > IncQueue_t
Definition IncidentSvc.h:80
tbb::concurrent_unordered_map< EventContext::ContextID_t, EventContext::ContextEvt_t > m_slotEvent
Event ID for each slot.
Definition IncidentSvc.h:84
@ DEBUG
Definition IMessageSvc.h:22

◆ getIncidents()

IIncidentSvc::IncidentPack IncidentSvc::getIncidents ( const EventContext * ctx)
override

Definition at line 236 of file IncidentSvc.cpp.

236 {
238 if ( ctx ) {
239 auto incs = m_firedIncidents.find( ctx->slot() );
240 if ( incs != m_firedIncidents.end() ) {
241 std::unique_ptr<Incident> inc;
242
243 DEBMSG << "Collecting listeners fired on context " << *ctx << endmsg;
244 while ( incs->second.try_pop( inc ) ) {
245 // ensure incident is for this event (should not be necessary)
246 if ( inc->context().evt() == ctx->evt() ) {
247 std::scoped_lock lock( m_listenerMapMutex );
248 auto i = m_listenerMap.find( inc->type() );
249 if ( i != m_listenerMap.end() ) {
250 p.emplace_back( std::move( inc ), std::vector<Listener>{ i->second->begin(), i->second->end() } );
251 }
252 }
253 }
254 }
255 }
256 return p;
257}
std::vector< std::pair< std::unique_ptr< Incident >, std::vector< Listener > > > IncidentPack
List of incidents and their listeners.

◆ getListeners()

void IncidentSvc::getListeners ( std::vector< IIncidentListener * > & lis,
const std::string & type = "" ) const
override

Definition at line 221 of file IncidentSvc.cpp.

221 {
222 static const std::string ALL{ "ALL" };
223 auto lock = std::scoped_lock{ m_listenerMapMutex };
224
225 const std::string& ltype = ( !type.empty() ? type : ALL );
226
227 l.clear();
228 auto i = m_listenerMap.find( ltype );
229 if ( i != m_listenerMap.end() ) {
230 l.reserve( i->second->size() );
231 std::transform( std::begin( *i->second ), std::end( *i->second ), std::back_inserter( l ),
232 []( const Listener& j ) { return j.iListener; } );
233 }
234}
dict l
Definition gaudirun.py:583

◆ i_fireIncident()

void IncidentSvc::i_fireIncident ( const Incident & incident,
const std::string & type )
private

Internal function to allow incidents listening to all events.

Definition at line 112 of file IncidentSvc.cpp.

112 {
113
114 auto lock = std::scoped_lock{ m_listenerMapMutex };
115
116 // Wouldn't it be better to write a small 'ReturnCode' service which
117 // looks for these 'special' incidents and does whatever needs to
118 // be done instead of making a special case here?
119
120 // Special case: FailInputFile incident must set the application return code
121 if ( incident.type() == IncidentType::FailInputFile || incident.type() == IncidentType::CorruptedInputFile ) {
122 auto appmgr = serviceLocator()->as<IProperty>();
123 Gaudi::setAppReturnCode( appmgr, incident.type() == IncidentType::FailInputFile
126 .ignore();
127 }
128
129 auto ilisteners = m_listenerMap.find( listenerType );
130 if ( m_listenerMap.end() == ilisteners ) return;
131
132 // setting this pointer will avoid that a call to removeListener() during
133 // the loop triggers a segfault
134 m_currentIncidentType = &incident.type();
135 std::string curIncTyp;
136 if ( m_currentIncidentType != nullptr ) {
137 curIncTyp = *m_currentIncidentType;
138 } else {
139 curIncTyp = "UNKNOWN";
140 }
141
142 bool firedSingleShot = false;
143
144 auto& listeners = *ilisteners->second;
145
146 for ( auto& listener : listeners ) {
147
148 VERMSG << "Calling '" << getListenerName( listener.iListener ) << "' for incident [" << incident.type() << "]"
149 << endmsg;
150
151 // handle exceptions if they occur
152 try {
153 listener.iListener->handle( incident );
154 } catch ( const GaudiException& exc ) {
155 error() << "Exception with tag=" << exc.tag()
156 << " is caught"
157 " handling incident "
158 << curIncTyp << " in listener " << getListenerName( listener.iListener ) << endmsg;
159 error() << exc << endmsg;
160 if ( listener.rethrow ) { throw exc; }
161 } catch ( const std::exception& exc ) {
162 error() << "Standard std::exception is caught"
163 " handling incident "
164 << curIncTyp << " in listener " << getListenerName( listener.iListener ) << endmsg;
165 error() << exc.what() << endmsg;
166 if ( listener.rethrow ) { throw exc; }
167 } catch ( ... ) {
168 error() << "UNKNOWN Exception is caught"
169 " handling incident "
170 << curIncTyp << " in listener " << getListenerName( listener.iListener ) << endmsg;
171 if ( listener.rethrow ) { throw; }
172 }
173 // check wheter one of the listeners is singleShot
174 firedSingleShot |= listener.singleShot;
175 }
176 if ( firedSingleShot ) {
177 // remove all the singleshot listeners that got their shot...
178 listeners.erase( std::remove_if( std::begin( listeners ), std::end( listeners ), isSingleShot ),
179 std::end( listeners ) );
180 if ( listeners.empty() ) m_listenerMap.erase( ilisteners );
181 }
182
183 m_currentIncidentType = nullptr;
184}
#define VERMSG
MsgStream & error() const
shortcut for the method msgStream(MSG::ERROR)
virtual const std::string & tag() const
name tag for the exception, or exception type
SmartIF< IFace > as()
Definition ISvcLocator.h:64
const std::string * m_currentIncidentType
Incident being fired.
Definition IncidentSvc.h:70
SmartIF< ISvcLocator > & serviceLocator() const override
Retrieve pointer to service locator.
Definition Service.cpp:336
const StatusCode & ignore() const
Allow discarding a StatusCode without warning.
Definition StatusCode.h:139
constexpr int FailInput
constexpr int CorruptedInput
StatusCode setAppReturnCode(SmartIF< IProperty > &appmgr, int value, bool force=false)
Set the application return code.

◆ removeListener()

void IncidentSvc::removeListener ( IIncidentListener * l,
const std::string & type = "" )
override

Definition at line 94 of file IncidentSvc.cpp.

94 {
95 auto lock = std::scoped_lock{ m_listenerMapMutex };
96
97 bool scheduleForRemoval = ( m_currentIncidentType && type == *m_currentIncidentType );
98 if ( type.empty() ) {
99 auto i = std::begin( m_listenerMap );
100 while ( i != std::end( m_listenerMap ) ) { i = removeListenerFromList( i, lis, scheduleForRemoval ); }
101 } else {
102 auto i = m_listenerMap.find( type );
103 if ( i != m_listenerMap.end() ) removeListenerFromList( i, lis, scheduleForRemoval );
104 }
105}
ListenerMap::iterator removeListenerFromList(ListenerMap::iterator, IIncidentListener *item, bool scheduleRemoval)

◆ removeListenerFromList()

IncidentSvc::ListenerMap::iterator IncidentSvc::removeListenerFromList ( ListenerMap::iterator i,
IIncidentListener * item,
bool scheduleRemoval )
private

Definition at line 77 of file IncidentSvc.cpp.

77 {
78 auto match = [&]( ListenerList::const_reference j ) { return !item || item == j.iListener; };
79
80 auto& c = *( i->second );
81 if ( !scheduleRemoval ) {
82 ON_DEBUG std::for_each( std::begin( c ), std::end( c ), [&]( ListenerList::const_reference j ) {
83 if ( match( j ) )
84 debug() << "Removing [" << i->first << "] listener '" << getListenerName( j.iListener ) << "'" << endmsg;
85 } );
86 c.erase( std::remove_if( std::begin( c ), std::end( c ), match ), std::end( c ) );
87 } else {
88 std::for_each( std::begin( c ), std::end( c ), [&]( Listener& i ) {
89 if ( match( i ) ) i.singleShot = true; // will trigger removal as soon as it is safe
90 } );
91 }
92 return c.empty() ? m_listenerMap.erase( i ) : std::next( i );
93}
#define ON_DEBUG

Member Data Documentation

◆ m_currentIncidentType

const std::string* IncidentSvc::m_currentIncidentType = nullptr
private

Incident being fired.

It is used to know if we can safely remove a listener or we have to schedule its removal for later.

Definition at line 70 of file IncidentSvc.h.

◆ m_firedIncidents

tbb::concurrent_unordered_map<EventContext::ContextID_t, IncQueue_t> IncidentSvc::m_firedIncidents
private

Definition at line 81 of file IncidentSvc.h.

◆ m_listenerMap

ListenerMap IncidentSvc::m_listenerMap
private

List of auditor names.

Definition at line 66 of file IncidentSvc.h.

◆ m_listenerMapMutex

std::recursive_mutex IncidentSvc::m_listenerMapMutex
mutableprivate

Mutex to synchronize access to m_listenerMap.

Definition at line 73 of file IncidentSvc.h.

◆ m_slotEvent

tbb::concurrent_unordered_map<EventContext::ContextID_t, EventContext::ContextEvt_t> IncidentSvc::m_slotEvent
private

Event ID for each slot.

Definition at line 84 of file IncidentSvc.h.

◆ m_timer

ChronoEntity IncidentSvc::m_timer
mutableprivate

timer & it's lock

Definition at line 76 of file IncidentSvc.h.

◆ m_timerLock

bool IncidentSvc::m_timerLock = false
mutableprivate

Definition at line 77 of file IncidentSvc.h.


The documentation for this class was generated from the following files: