Gaudi Framework, version v24r2
Home
Generated: Wed Dec 4 2013
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Groups
Pages
GaudiCoreSvc
src
IncidentSvc
IncidentSvc.h
Go to the documentation of this file.
1
// $Id:$
2
// ============================================================================
3
#ifndef IncidentSvc_IncidentSvc_H
4
#define IncidentSvc_IncidentSvc_H
5
// ============================================================================
6
// Include Files
7
// ============================================================================
8
// STD & STL
9
// ============================================================================
10
#include <
map
>
11
#include <
list
>
12
// ============================================================================
13
// GaudiKernel
14
// ============================================================================
15
#include "
GaudiKernel/Service.h
"
16
#include "
GaudiKernel/SvcFactory.h
"
17
#include "
GaudiKernel/IIncidentSvc.h
"
18
#include "
GaudiKernel/StringKey.h
"
19
#include "
GaudiKernel/StringKey.h
"
20
#include "
GaudiKernel/HashMap.h
"
21
#include "
GaudiKernel/ChronoEntity.h
"
22
// ============================================================================
23
// Booots
24
// ============================================================================
25
#include "boost/thread/recursive_mutex.hpp"
26
// ============================================================================
37
class
IncidentSvc
:
public
extends1
<Service, IIncidentSvc>
38
{
39
// ==========================================================================
40
public
:
41
// ==========================================================================
42
struct
Listener
43
{
44
IIncidentListener
*
iListener
;
45
long
priority
;
46
bool
rethrow
;
47
bool
singleShot
;
48
49
Listener
(
IIncidentListener
* il,
long
pri,
bool
thr=
false
,
bool
single=
false
):
50
iListener
(il),
priority
(pri),
rethrow
(thr),
singleShot
(single){}
51
52
};
53
54
// Typedefs
55
typedef
std::list<Listener>
ListenerList
;
56
// typedef std::map<std::string, ListenerList*> ListenerMap;
57
typedef
GaudiUtils::HashMap<Gaudi::StringKey, ListenerList*>
ListenerMap
;
58
59
// Inherited Service overrides:
60
//
61
virtual
StatusCode
initialize
();
62
virtual
StatusCode
finalize
();
63
64
// IIncidentSvc interfaces overwrite
65
//
66
virtual
void
addListener
67
(
IIncidentListener
* lis ,
68
const
std::string
&
type
=
""
,
69
long
priority = 0 ,
70
bool
rethrow =
false
,
71
bool
singleShot =
false
) ;
72
73
virtual
void
removeListener
74
(
IIncidentListener
* lis ,
75
const
std::string
&
type
=
""
) ;
76
virtual
void
fireIncident
77
(
const
Incident
& incident ) ;
78
79
virtual
void
getListeners
(
std::vector<IIncidentListener*>
& lis,
80
const
std::string
&
type
=
""
)
const
;
81
82
// Standard Constructor.
83
IncidentSvc
(
const
std::string
&
name
,
ISvcLocator
* svc );
84
// Destructor.
85
virtual
~IncidentSvc
();
86
87
private
:
88
// ==========================================================================
90
void
i_fireIncident
(
const
Incident
& incident,
const
std::string
&
type
);
91
93
ListenerMap
m_listenerMap
;
94
97
const
std::string
*
m_currentIncidentType
;
98
100
mutable
boost::recursive_mutex
m_listenerMapMutex
;
101
103
mutable
ChronoEntity
m_timer
;
104
mutable
bool
m_timerLock
;
105
// ==========================================================================
106
107
};
108
// ============================================================================
109
// The END
110
// ============================================================================
111
#endif
112
// ============================================================================
113
114
Generated at Wed Dec 4 2013 14:33:08 for Gaudi Framework, version v24r2 by
Doxygen
version 1.8.2 written by
Dimitri van Heesch
, © 1997-2004