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