The Gaudi Framework
master (1a7a3838)
Toggle main menu visibility
Loading...
Searching...
No Matches
IIncidentSvc.h
Go to the documentation of this file.
1
/***********************************************************************************\
2
* (c) Copyright 1998-2025 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
#pragma once
12
13
#include <
GaudiKernel/EventContextHash.h
>
14
#include <
GaudiKernel/IInterface.h
>
15
#include <
GaudiKernel/Incident.h
>
16
#include <memory>
17
#include <string>
18
#include <vector>
19
20
class
IIncidentListener
;
21
30
class
GAUDI_API
IIncidentSvc
:
virtual
public
IInterface
{
31
public
:
33
DeclareInterfaceID
(
IIncidentSvc
, 2, 0 );
34
40
virtual
void
addListener
(
IIncidentListener
* lis,
const
std::string& type =
""
,
long
priority = 0,
41
bool
rethrow =
false
,
bool
singleShot =
false
) = 0;
46
virtual
void
removeListener
(
IIncidentListener
* lis,
const
std::string& type =
""
) = 0;
47
48
//@TODO: return vector by value instead...
49
virtual
void
getListeners
( std::vector<IIncidentListener*>& lis,
const
std::string& type =
""
)
const
= 0;
50
54
virtual
void
fireIncident
(
const
Incident
& incident ) = 0;
55
57
struct
Listener
final {
58
IIncidentListener
*
iListener
{
nullptr
};
59
long
priority
{ 0 };
60
bool
rethrow
{
false
};
61
bool
singleShot
{
false
};
62
};
63
65
typedef
std::vector<std::pair<std::unique_ptr<Incident>, std::vector<Listener>>>
IncidentPack
;
66
68
virtual
IIncidentSvc::IncidentPack
getIncidents
(
const
EventContext
* ctx ) = 0;
69
74
virtual
void
fireIncident
( std::unique_ptr<Incident> incident ) = 0;
75
};
EventContextHash.h
IInterface.h
Incident.h
GAUDI_API
#define GAUDI_API
Definition
Kernel.h:49
EventContext
This class represents an entry point to all the event specific data.
Definition
EventContext.h:35
IIncidentListener
The interface implemented by any class wanting to listen to Incidents.
Definition
IIncidentListener.h:23
IIncidentSvc
The interface implemented by the IncidentSvc service.
Definition
IIncidentSvc.h:30
IIncidentSvc::getIncidents
virtual IIncidentSvc::IncidentPack getIncidents(const EventContext *ctx)=0
Get List of asynchronous incidents and their listeners.
IIncidentSvc::IncidentPack
std::vector< std::pair< std::unique_ptr< Incident >, std::vector< Listener > > > IncidentPack
List of incidents and their listeners.
Definition
IIncidentSvc.h:65
IIncidentSvc::fireIncident
virtual void fireIncident(std::unique_ptr< Incident > incident)=0
Fire an Incident, Incident ownership has to be passed to the service since it is going to be accessed...
IIncidentSvc::DeclareInterfaceID
DeclareInterfaceID(IIncidentSvc, 2, 0)
InterfaceID.
IIncidentSvc::getListeners
virtual void getListeners(std::vector< IIncidentListener * > &lis, const std::string &type="") const =0
IIncidentSvc::fireIncident
virtual void fireIncident(const Incident &incident)=0
Fire an Incident.
IIncidentSvc::removeListener
virtual void removeListener(IIncidentListener *lis, const std::string &type="")=0
Remove listener.
IIncidentSvc::addListener
virtual void addListener(IIncidentListener *lis, const std::string &type="", long priority=0, bool rethrow=false, bool singleShot=false)=0
Add listener.
IInterface
Definition of the basic interface.
Definition
IInterface.h:225
Incident
Base class for all Incidents (computing events).
Definition
Incident.h:24
IIncidentSvc::Listener
Listener properties.
Definition
IIncidentSvc.h:57
IIncidentSvc::Listener::iListener
IIncidentListener * iListener
Definition
IIncidentSvc.h:58
IIncidentSvc::Listener::rethrow
bool rethrow
Definition
IIncidentSvc.h:60
IIncidentSvc::Listener::priority
long priority
Definition
IIncidentSvc.h:59
IIncidentSvc::Listener::singleShot
bool singleShot
Definition
IIncidentSvc.h:61
GaudiKernel
include
GaudiKernel
IIncidentSvc.h
Generated on
for The Gaudi Framework by
1.17.0