IIncidentSvc.h
Go to the documentation of this file.
1 #ifndef INTERFACES_IINCIDENTSVC_H
2 #define INTERFACES_IINCIDENTSVC_H
3 
4 // Include Files
6 #include <string>
7 #include <vector>
8 #include <memory>
10 #include "GaudiKernel/Incident.h"
11 // Forward declarations
12 class IIncidentListener;
13 //class Incident;
14 
23 class GAUDI_API IIncidentSvc: virtual public IInterface {
24 public:
27 
33  virtual void addListener(IIncidentListener* lis,
34  const std::string& type = "",
35  long priority = 0,
36  bool rethrow = false,
37  bool singleShot = false ) = 0;
42  virtual void removeListener(IIncidentListener* lis,
43  const std::string& type = "" ) = 0;
44 
45  //@TODO: return vector by value instead...
46  virtual void getListeners(std::vector<IIncidentListener*>& lis,
47  const std::string& type = "") const = 0;
48 
52  virtual void fireIncident( const Incident& incident ) = 0;
53 
54  class IncidentPack{
55  public:
58  IncidentPack(IncidentPack&& o):incidents(std::move(o.incidents)),listeners(std::move(o.listeners)){};
59  IncidentPack& operator=(IncidentPack&& o){incidents=std::move(o.incidents);listeners=std::move(o.listeners);return *this;};
61  };
62 
63  virtual IIncidentSvc::IncidentPack getIncidents(const EventContext* ctx)=0;
68  virtual void fireIncident( std::unique_ptr<Incident> incident) = 0;
69 
70 };
71 
72 #endif // GAUDIKERNEL_IINCIDENTSVC_H
#define DeclareInterfaceID(iface, major, minor)
Macro to declare the interface ID when using the new mechanism of extending and implementing interfac...
Definition: IInterface.h:14
STL namespace.
This class represents an entry point to all the event specific data.
Definition: EventContext.h:25
std::vector< std::unique_ptr< Incident > > incidents
Definition: IIncidentSvc.h:56
STL class.
The interface implemented by any class wanting to listen to Incidents.
Definition of the basic interface.
Definition: IInterface.h:234
IncidentPack(IncidentPack &&o)
Definition: IIncidentSvc.h:58
std::vector< std::vector< IIncidentListener * > > listeners
Definition: IIncidentSvc.h:57
T move(T...args)
IncidentPack & operator=(IncidentPack &&o)
Definition: IIncidentSvc.h:59
STL class.
Base class for all Incidents (computing events).
Definition: Incident.h:17
#define GAUDI_API
Definition: Kernel.h:107
The interface implemented by the IncidentSvc service.
Definition: IIncidentSvc.h:23