Gaudi Framework, version v23r5
Home
Generated: Wed Nov 28 2012
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
// Standard Constructor.
80
IncidentSvc
(
const
std::string
&
name
,
ISvcLocator
* svc );
81
// Destructor.
82
virtual
~IncidentSvc
();
83
84
private
:
85
// ==========================================================================
87
void
i_fireIncident
(
const
Incident
& incident,
const
std::string
&
type
);
88
90
ListenerMap
m_listenerMap
;
91
94
const
std::string
*
m_currentIncidentType
;
95
97
boost::recursive_mutex
m_listenerMapMutex
;
98
100
mutable
ChronoEntity
m_timer
;
101
mutable
bool
m_timerLock
;
102
// ==========================================================================
103
104
};
105
// ============================================================================
106
// The END
107
// ============================================================================
108
#endif
109
// ============================================================================
110
111
Generated at Wed Nov 28 2012 12:17:12 for Gaudi Framework, version v23r5 by
Doxygen
version 1.8.2 written by
Dimitri van Heesch
, © 1997-2004