00001
00002 #ifndef IncidentSvc_IncidentSvc_H
00003 #define IncidentSvc_IncidentSvc_H
00004
00005
00006 #include "GaudiKernel/Service.h"
00007 #include "GaudiKernel/SvcFactory.h"
00008 #include "GaudiKernel/IIncidentSvc.h"
00009
00010 #include <map>
00011 #include <list>
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 class IncidentSvc : public Service, virtual public IIncidentSvc {
00024
00025 public:
00026
00027
00028 typedef std::pair<IIncidentListener*,long> Listener;
00029 typedef std::list<Listener> ListenerList;
00030 typedef std::map<std::string, ListenerList*> ListenerMap;
00031
00032
00033
00034 virtual StatusCode initialize();
00035 virtual StatusCode finalize();
00036 virtual StatusCode queryInterface( const IID& riid, void** ppvInterface );
00037
00038
00039
00040 virtual void addListener(IIncidentListener* lis, const std::string& type = "", long priority = 0);
00041 virtual void removeListener(IIncidentListener* lis, const std::string& type = "");
00042 virtual void fireIncident( const Incident& incident );
00043
00044 protected:
00045
00046
00047 IncidentSvc( const std::string& name, ISvcLocator* svc );
00048
00049 virtual ~IncidentSvc();
00050
00051 private:
00052
00053 friend class SvcFactory<IncidentSvc>;
00054
00055
00056 ListenerMap m_listenerMap;
00057 };
00058
00059 #endif
00060
00061