| The Gaudi Framework v29r0 (ff2e7097)

- 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/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 {
25 public:
27 DeclareInterfaceID( IIncidentSvc, 2, 0 );
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
50 class IncidentPack
51 {
52 public:
53 std::vector<std::unique_ptr<Incident>> incidents;
54 std::vector<std::vector<IIncidentListener*>> listeners;
55 IncidentPack( IncidentPack&& o ) : incidents( std::move( o.incidents ) ), listeners( std::move( o.listeners ) ){};
56 IncidentPack& operator=( IncidentPack&& o )
57 {
58 incidents = std::move( o.incidents );
59 listeners = std::move( o.listeners );
60 return *this;
61 };
62 IncidentPack(){};
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
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:53
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:62
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
IInterface
Definition of the basic interface.
Definition: IInterface.h:277
gaudirun.type
type
Definition: gaudirun.py:133
IIncidentSvc::IncidentPack::IncidentPack
IncidentPack(IncidentPack &&o)
Definition: IIncidentSvc.h:55
IIncidentSvc::IncidentPack::listeners
std::vector< std::vector< IIncidentListener * > > listeners
Definition: IIncidentSvc.h:54
IIncidentSvc::IncidentPack
Definition: IIncidentSvc.h:50
std::move
T move(T...args)
IIncidentSvc::IncidentPack::operator=
IncidentPack & operator=(IncidentPack &&o)
Definition: IIncidentSvc.h:56
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:110
IInterface.h
IIncidentSvc
The interface implemented by the IncidentSvc service.
Definition: IIncidentSvc.h:23