Gaudi Framework, version v25r2

Home   Generated: Wed Jun 4 2014
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
IncidentSvc.h
Go to the documentation of this file.
1 #ifndef IncidentSvc_IncidentSvc_H
2 #define IncidentSvc_IncidentSvc_H
3 // ============================================================================
4 // Include Files
5 // ============================================================================
6 // STD & STL
7 // ============================================================================
8 #include <map>
9 #include <list>
10 // ============================================================================
11 // GaudiKernel
12 // ============================================================================
13 #include "GaudiKernel/Service.h"
15 #include "GaudiKernel/StringKey.h"
16 #include "GaudiKernel/StringKey.h"
17 #include "GaudiKernel/HashMap.h"
19 // ============================================================================
20 // Boost
21 // ============================================================================
22 #include "boost/thread/recursive_mutex.hpp"
23 // ============================================================================
34 class IncidentSvc : public extends1<Service, IIncidentSvc>
35 {
36  // ==========================================================================
37 public:
38  // ==========================================================================
39  struct Listener
40  {
42  long priority;
43  bool rethrow;
44  bool singleShot;
45 
46  Listener(IIncidentListener* il, long pri, bool thr=false, bool single=false):
47  iListener(il), priority(pri), rethrow(thr), singleShot(single){}
48 
49  };
50 
51  // Typedefs
52  typedef std::list<Listener> ListenerList;
53  // typedef std::map<std::string, ListenerList*> ListenerMap;
55 
56  // Inherited Service overrides:
57  //
58  virtual StatusCode initialize();
59  virtual StatusCode finalize();
60 
61  // IIncidentSvc interfaces overwrite
62  //
63  virtual void addListener
64  ( IIncidentListener* lis ,
65  const std::string& type = "" ,
66  long priority = 0 ,
67  bool rethrow = false ,
68  bool singleShot = false ) ;
69 
70  virtual void removeListener
71  ( IIncidentListener* lis ,
72  const std::string& type = "" ) ;
73  virtual void fireIncident
74  ( const Incident& incident ) ;
75 
76  virtual void getListeners (std::vector<IIncidentListener*>& lis,
77  const std::string& type = "") const ;
78 
79  // Standard Constructor.
80  IncidentSvc( const std::string& name, ISvcLocator* svc );
81  // Destructor.
82  virtual ~IncidentSvc();
83 
84 private:
85  // ==========================================================================
87  void i_fireIncident(const Incident& incident, const std::string& type);
88 
91 
94  const std::string *m_currentIncidentType;
95 
97  mutable boost::recursive_mutex m_listenerMapMutex;
98 
101  mutable bool m_timerLock ;
102  // ==========================================================================
103 
104 };
105 // ============================================================================
106 // The END
107 // ============================================================================
108 #endif
109 // ============================================================================
110 
111 

Generated at Wed Jun 4 2014 14:48:56 for Gaudi Framework, version v25r2 by Doxygen version 1.8.2 written by Dimitri van Heesch, © 1997-2004