| The Gaudi Framework v28r2-patches (bc4ad17a)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

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/IInterface.h"
6 #include <string>
7 #include <vector>
8 #include <memory>
9 #include "GaudiKernel/EventContextHash.h"
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:
26 DeclareInterfaceID(IIncidentSvc,2,0);
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:
56 std::vector<std::unique_ptr<Incident>> incidents;
57 std::vector<std::vector<IIncidentListener*>> listeners;
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;};
60 IncidentPack(){};
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
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:14
std
STL namespace.
EventContext
This class represents an entry point to all the event specific data.
Definition: EventContext.h:25
EventContextHash.h
IIncidentSvc::IncidentPack::incidents
std::vector< std::unique_ptr< Incident > > incidents
Definition: IIncidentSvc.h:56
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:60
IInterface
Definition of the basic interface.
Definition: IInterface.h:234
gaudirun.type
type
Definition: gaudirun.py:125
IIncidentSvc::IncidentPack::IncidentPack
IncidentPack(IncidentPack &&o)
Definition: IIncidentSvc.h:58
IIncidentSvc::IncidentPack::listeners
std::vector< std::vector< IIncidentListener * > > listeners
Definition: IIncidentSvc.h:57
IIncidentSvc::IncidentPack
Definition: IIncidentSvc.h:54
std::move
T move(T...args)
IIncidentSvc::IncidentPack::operator=
IncidentPack & operator=(IncidentPack &&o)
Definition: IIncidentSvc.h:59
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:107
IInterface.h
IIncidentSvc
The interface implemented by the IncidentSvc service.
Definition: IIncidentSvc.h:23