| The Gaudi Framework v32r1 (f65d50dc)

IIncidentSvc.h
Go to the documentation of this file.
1 #ifndef INTERFACES_IINCIDENTSVC_H
2 #define INTERFACES_IINCIDENTSVC_H
3
4 // Include Files
5 #include "GaudiKernel/EventContextHash.h"
6 #include "GaudiKernel/IInterface.h"
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 public:
26 DeclareInterfaceID( IIncidentSvc, 2, 0 );
27
33 virtual void addListener( IIncidentListener* lis, const std::string& type = "", long priority = 0,
34 bool rethrow = false, bool singleShot = false ) = 0;
39 virtual void removeListener( IIncidentListener* lis, const std::string& type = "" ) = 0;
40
41 //@TODO: return vector by value instead...
42 virtual void getListeners( std::vector<IIncidentListener*>& lis, const std::string& type = "" ) const = 0;
43
47 virtual void fireIncident( const Incident& incident ) = 0;
48
49 class IncidentPack {
50 public:
51 std::vector<std::unique_ptr<Incident>> incidents;
52 std::vector<std::vector<IIncidentListener*>> listeners;
53 IncidentPack( IncidentPack&& o ) : incidents( std::move( o.incidents ) ), listeners( std::move( o.listeners ) ){};
54 IncidentPack& operator=( IncidentPack&& o ) {
55 incidents = std::move( o.incidents );
56 listeners = std::move( o.listeners );
57 return *this;
58 };
59 IncidentPack(){};
60 };
61
62 virtual IIncidentSvc::IncidentPack getIncidents( const EventContext* ctx ) = 0;
67 virtual void fireIncident( std::unique_ptr<Incident> incident ) = 0;
68 };
69
70 #endif // GAUDIKERNEL_IINCIDENTSVC_H
std
STL namespace.
EventContext
This class represents an entry point to all the event specific data.
Definition: EventContext.h:24
EventContextHash.h
IIncidentSvc::IncidentPack::incidents
std::vector< std::unique_ptr< Incident > > incidents
Definition: IIncidentSvc.h:51
std::string
STL class.
Incident.h
IIncidentListener
The interface implemented by any class wanting to listen to Incidents.
Definition: IIncidentListener.h:15
IIncidentSvc::IncidentPack::IncidentPack
IncidentPack()
Definition: IIncidentSvc.h:59
IInterface
Definition of the basic interface.
Definition: IInterface.h:244
gaudirun.type
type
Definition: gaudirun.py:142
IIncidentSvc::IncidentPack::IncidentPack
IncidentPack(IncidentPack &&o)
Definition: IIncidentSvc.h:53
IIncidentSvc::IncidentPack::listeners
std::vector< std::vector< IIncidentListener * > > listeners
Definition: IIncidentSvc.h:52
IIncidentSvc::IncidentPack
Definition: IIncidentSvc.h:49
std::move
T move(T... args)
DeclareInterfaceID
#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
IIncidentSvc::IncidentPack::operator=
IncidentPack & operator=(IncidentPack &&o)
Definition: IIncidentSvc.h:54
std::vector
STL class.
std::unique_ptr< Incident >
Incident
Base class for all Incidents (computing events).
Definition: Incident.h:17
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:71
IInterface.h
IIncidentSvc
The interface implemented by the IncidentSvc service.
Definition: IIncidentSvc.h:23