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
DataOnDemandSvc.h
Go to the documentation of this file.
1
#ifndef GAUDISVC_DATAONDEMANDSVC_H
2
#define GAUDISVC_DATAONDEMANDSVC_H
3
// ============================================================================
4
// Include Files
5
// ============================================================================
6
// STD & STL
7
// ============================================================================
8
#include <
map
>
9
#include <
vector
>
10
// ============================================================================
11
// GaudiKernel
12
// ============================================================================
13
#include "
GaudiKernel/Service.h
"
14
#include "
GaudiKernel/SvcFactory.h
"
15
#include "
GaudiKernel/IIncidentListener.h
"
16
#include "
GaudiKernel/ChronoEntity.h
"
17
#include "
GaudiKernel/StatEntity.h
"
18
#include "
GaudiKernel/StringKey.h
"
19
#include "
GaudiKernel/IDODAlgMapper.h
"
20
#include "
GaudiKernel/IDODNodeMapper.h
"
21
// ============================================================================
22
// Reflex
23
// ============================================================================
24
#include "Reflex/Reflex.h"
25
// ============================================================================
26
// Forward declarations
27
// ============================================================================
28
class
IAlgTool
;
29
class
IAlgorithm
;
30
class
IAlgManager
;
31
class
IIncidentSvc
;
32
class
IDataProviderSvc
;
33
class
IToolSvc
;
34
// ============================================================================
91
class
DataOnDemandSvc
:
public
extends1
<Service, IIncidentListener>
92
{
93
public
:
94
// ==========================================================================
95
// Typedefs
96
typedef
std::vector<std::string>
Setup
;
97
typedef
ROOT::Reflex::Type
ClassH
;
98
// ==========================================================================
103
struct
Protection
104
{
105
bool
&
m_bool
;
106
Protection
(
bool
& b) :
m_bool
(b) {
m_bool
=
true
; }
107
~Protection
() {
m_bool
=
false
; }
108
};
109
// ==========================================================================
115
struct
Node
116
{
117
// ========================================================================
119
ClassH
clazz
;
// the actual class
120
bool
executing
;
121
std::string
name
;
122
unsigned
long
num
;
124
bool
dataObject
;
// trivial object? DataObject?
125
// =======================================================================
126
Node
()
127
:
clazz
( )
128
,
executing
( false )
129
,
name
( )
130
,
num
( 0 )
131
,
dataObject
( false )
132
{}
133
// ========================================================================
134
Node
(
ClassH
c
,
135
bool
e ,
136
const
std::string
& n )
137
:
clazz
( c )
138
,
executing
( e )
139
,
name
( n )
140
,
num
( 0 )
141
,
dataObject
(
"DataObject"
== n )
142
{}
143
//
144
Node
(
const
Node
&
c
)
145
:
clazz
( c.
clazz
)
146
,
executing
( c.
executing
)
147
,
name
( c.
name
)
148
,
num
( c.
num
)
149
,
dataObject
( c.
dataObject
)
150
{}
151
// ========================================================================
152
};
153
// ==========================================================================
155
struct
Leaf
156
{
157
IAlgorithm
*
algorithm
;
158
bool
executing
;
159
std::string
name
;
160
std::string
type
;
161
unsigned
long
num
;
162
Leaf
() :
algorithm
( 0 ) ,
executing
(false ) ,
name
() ,
type
() ,
num
( 0 ) {}
163
Leaf
(
const
Leaf
&
l
)
164
:
algorithm
(l.
algorithm
),
165
executing
(l.
executing
),
name
(l.
name
),
type
(l.
type
),
num
(l.
num
) {}
166
Leaf
(
const
std::string
& t,
const
std::string
& n)
167
:
algorithm
(0),
executing
(false),
name
(n),
type
(t),
num
(0) {}
168
};
169
// ==========================================================================
170
public
:
171
// ==========================================================================
172
typedef
GaudiUtils::HashMap<Gaudi::StringKey, Node>
NodeMap
;
173
typedef
GaudiUtils::HashMap<Gaudi::StringKey, Leaf>
AlgMap
;
175
virtual
StatusCode
initialize
();
177
virtual
StatusCode
finalize
();
179
virtual
StatusCode
reinitialize
();
181
virtual
void
handle
(
const
Incident
& incident);
187
DataOnDemandSvc
188
(
const
std::string
&
name
,
// Service instance name
189
ISvcLocator
* svc ) ;
// Pointer to service locator
191
virtual
~DataOnDemandSvc
();
// Standard destructor
192
// ==========================================================================
193
protected
:
194
// ==========================================================================
199
StatusCode
configureHandler
(
Leaf
& leaf);
200
// ==========================================================================
206
StatusCode
execHandler
(
const
std::string
& tag,
Leaf
& leaf);
207
// ==========================================================================
213
StatusCode
execHandler
(
const
std::string
& tag,
Node
& node);
214
// ==========================================================================
216
StatusCode
setupNodeHandlers
();
217
// ==========================================================================
219
StatusCode
setupAlgHandlers
();
220
// ==========================================================================
222
StatusCode
setup
();
224
void
i_setNodeHandler
(
const
std::string
&
name
,
const
std::string
&
type
);
226
StatusCode
i_setAlgHandler
(
const
std::string
&
name
,
const
Gaudi::Utils::TypeNameString &alg);
227
// ==========================================================================
228
public
:
229
// ==========================================================================
230
void
update_1
(
Property
& p ) ;
231
void
update_2
(
Property
& p ) ;
232
void
update_3
(
Property
& p ) ;
234
void
update_dump
(
Property
&
/* p */
) ;
// update handler for 'Dump' property
235
// ==========================================================================
236
protected
:
237
// ==========================================================================
239
StatusCode
update
() ;
241
inline
MsgStream
&
stream
()
const
242
{
243
if
( 0 ==
m_log
) {
m_log
=
new
MsgStream
(
msgSvc
() ,
name
() ) ; }
244
return
*
m_log
;
245
}
250
void
dump
(
const
MSG::Level
level
,
const
bool
mode =
true
)
const
;
251
// ==========================================================================
252
private
:
253
// ==========================================================================
255
SmartIF<IIncidentSvc>
m_incSvc
;
257
SmartIF<IAlgManager>
m_algMgr
;
259
SmartIF<IDataProviderSvc>
m_dataSvc
;
261
SmartIF<IToolSvc>
m_toolSvc
;
263
std::string
m_trapType
;
265
std::string
m_dataSvcName
;
267
bool
m_partialPath
;
269
bool
m_dump
;
271
bool
m_init
;
274
bool
m_allowInitFailure
;
276
Setup
m_algMapping
;
278
Setup
m_nodeMapping
;
280
AlgMap
m_algs
;
282
NodeMap
m_nodes
;
283
//
284
typedef
std::map<std::string,std::string>
Map
;
286
Map
m_algMap
;
// { 'data' : 'algorithm' }
288
Map
m_nodeMap
;
// { 'data' : 'type' }
289
bool
m_updateRequired
;
290
std::string
m_prefix
;
291
mutable
MsgStream
*
m_log
;
292
// ==========================================================================
293
ChronoEntity
m_total
;
294
ulonglong
m_statAlg
;
295
ulonglong
m_statNode
;
296
ulonglong
m_stat
;
297
// ==========================================================================
298
ChronoEntity
m_timer_nodes
;
299
ChronoEntity
m_timer_algs
;
300
ChronoEntity
m_timer_all
;
301
bool
m_locked_nodes
;
302
bool
m_locked_algs
;
303
bool
m_locked_all
;
304
// ==========================================================================
305
std::vector<std::string>
m_nodeMapTools
;
306
std::list<IDODNodeMapper *>
m_nodeMappers
;
307
std::vector<std::string>
m_algMapTools
;
308
std::list<IDODAlgMapper *>
m_algMappers
;
309
};
310
// ============================================================================
311
312
// ============================================================================
313
// The END
314
// ============================================================================
315
#endif // GAUDISVC_DATAONDEMANDSVC_H
316
// ============================================================================
317
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