Skip to content
Snippets Groups Projects
Commit d79ce220 authored by Marco Clemencic's avatar Marco Clemencic
Browse files

use std::list for ListenerList in IncidentSvc

Using std::list instead of std::vector allows the
possibility of listeners being added during the handling of
an incident, which cannot be forbidden because a handler may
trigger instantiation of a component that wants to be
registered.

From Scott Snyder. See atlas/Gaudi!20

See merge request !164
parents b29534a0 be330fe7
No related branches found
No related tags found
1 merge request!164ListenerList in IncidentSvc should be std::list, not std::vector.
Pipeline #
...@@ -47,7 +47,9 @@ class IncidentSvc : public extends<Service, ...@@ -47,7 +47,9 @@ class IncidentSvc : public extends<Service,
private: private:
// Typedefs // Typedefs
typedef std::vector<Listener> ListenerList; // ListenerList should be a list rather than a vector because handing
// a fired incident may result in a call to addListener.
typedef std::list<Listener> ListenerList;
typedef GaudiUtils::HashMap<Gaudi::StringKey, std::unique_ptr<ListenerList>> ListenerMap; typedef GaudiUtils::HashMap<Gaudi::StringKey, std::unique_ptr<ListenerList>> ListenerMap;
public: public:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment