The Gaudi Framework
v33r1 (b1225454)
IIncidentSvc.h
Go to the documentation of this file.
1
/***********************************************************************************\
2
* (c) Copyright 1998-2019 CERN for the benefit of the LHCb and ATLAS collaborations *
3
* *
4
* This software is distributed under the terms of the Apache version 2 licence, *
5
* copied verbatim in the file "LICENSE". *
6
* *
7
* In applying this licence, CERN does not waive the privileges and immunities *
8
* granted to it by virtue of its status as an Intergovernmental Organization *
9
* or submit itself to any jurisdiction. *
10
\***********************************************************************************/
11
#ifndef INTERFACES_IINCIDENTSVC_H
12
#define INTERFACES_IINCIDENTSVC_H
13
14
// Include Files
15
#include "
GaudiKernel/EventContextHash.h
"
16
#include "
GaudiKernel/IInterface.h
"
17
#include "
GaudiKernel/Incident.h
"
18
#include <memory>
19
#include <string>
20
#include <vector>
21
// Forward declarations
22
class
IIncidentListener
;
23
// class Incident;
24
33
class
GAUDI_API
IIncidentSvc
:
virtual
public
IInterface
{
34
public
:
36
DeclareInterfaceID
(
IIncidentSvc
, 2, 0 );
37
43
virtual
void
addListener(
IIncidentListener
* lis,
const
std::string
&
type
=
""
,
long
priority = 0,
44
bool
rethrow =
false
,
bool
singleShot =
false
) = 0;
49
virtual
void
removeListener(
IIncidentListener
* lis,
const
std::string
&
type
=
""
) = 0;
50
51
//@TODO: return vector by value instead...
52
virtual
void
getListeners(
std::vector<IIncidentListener*>
& lis,
const
std::string
&
type
=
""
)
const
= 0;
53
57
virtual
void
fireIncident(
const
Incident
& incident ) = 0;
58
59
class
IncidentPack
{
60
public
:
61
std::vector<std::unique_ptr<Incident>
>
incidents
;
62
std::vector<std::vector<IIncidentListener*>
>
listeners
;
63
IncidentPack
(
IncidentPack
&& o ) : incidents(
std
::move( o.incidents ) ), listeners(
std
::move( o.listeners ) ){};
64
IncidentPack
&
operator=
(
IncidentPack
&& o ) {
65
incidents =
std::move
( o.incidents );
66
listeners =
std::move
( o.listeners );
67
return
*
this
;
68
};
69
IncidentPack
(){};
70
};
71
72
virtual
IIncidentSvc::IncidentPack
getIncidents(
const
EventContext
*
ctx
) = 0;
77
virtual
void
fireIncident(
std::unique_ptr<Incident>
incident ) = 0;
78
};
79
80
#endif // GAUDIKERNEL_IINCIDENTSVC_H
GaudiPython.Pythonizations.ctx
ctx
Definition:
Pythonizations.py:566
std
STL namespace.
EventContext
This class represents an entry point to all the event specific data.
Definition:
EventContext.h:34
EventContextHash.h
IIncidentSvc::IncidentPack::incidents
std::vector< std::unique_ptr< Incident > > incidents
Definition:
IIncidentSvc.h:61
std::string
STL class.
Incident.h
IIncidentListener
The interface implemented by any class wanting to listen to Incidents.
Definition:
IIncidentListener.h:25
IIncidentSvc::IncidentPack::IncidentPack
IncidentPack()
Definition:
IIncidentSvc.h:69
IInterface
Definition of the basic interface.
Definition:
IInterface.h:254
gaudirun.type
type
Definition:
gaudirun.py:154
IIncidentSvc::IncidentPack::IncidentPack
IncidentPack(IncidentPack &&o)
Definition:
IIncidentSvc.h:63
IIncidentSvc::IncidentPack::listeners
std::vector< std::vector< IIncidentListener * > > listeners
Definition:
IIncidentSvc.h:62
IIncidentSvc::IncidentPack
Definition:
IIncidentSvc.h:59
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:23
IIncidentSvc::IncidentPack::operator=
IncidentPack & operator=(IncidentPack &&o)
Definition:
IIncidentSvc.h:64
std::vector
STL class.
std::unique_ptr< Incident >
Incident
Base class for all Incidents (computing events).
Definition:
Incident.h:27
GAUDI_API
#define GAUDI_API
Definition:
Kernel.h:81
IInterface.h
IIncidentSvc
The interface implemented by the IncidentSvc service.
Definition:
IIncidentSvc.h:33
GaudiKernel
GaudiKernel
IIncidentSvc.h
Generated on Mon Mar 23 2020 15:31:02 for The Gaudi Framework by
1.8.15