Gaudi Framework, version v25r2
Home
Generated: Wed Jun 4 2014
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
.cern.ch
sw
Gaudi
releases
GAUDI
GAUDI_v25r2
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/IIncidentListener.h
"
15
#include "
GaudiKernel/ChronoEntity.h
"
16
#include "
GaudiKernel/StatEntity.h
"
17
#include "
GaudiKernel/StringKey.h
"
18
#include "
GaudiKernel/IDODAlgMapper.h
"
19
#include "
GaudiKernel/IDODNodeMapper.h
"
20
// ============================================================================
21
// ROOT TClass
22
// ============================================================================
23
#include "TClass.h"
24
// ============================================================================
25
// Forward declarations
26
// ============================================================================
27
class
IAlgTool
;
28
class
IAlgorithm
;
29
class
IAlgManager
;
30
class
IIncidentSvc
;
31
class
IDataProviderSvc
;
32
class
IToolSvc
;
33
// ============================================================================
90
class
DataOnDemandSvc
:
public
extends1
<Service, IIncidentListener>
91
{
92
public
:
93
// ==========================================================================
94
// Typedefs
95
typedef
std::vector<std::string>
Setup
;
96
typedef
TClass*
ClassH
;
97
// ==========================================================================
102
struct
Protection
103
{
104
bool
&
m_bool
;
105
Protection
(
bool
& b) :
m_bool
(b) {
m_bool
=
true
; }
106
~Protection
() {
m_bool
=
false
; }
107
};
108
// ==========================================================================
114
struct
Node
115
{
116
// ========================================================================
118
ClassH
clazz
;
// the actual class
119
bool
executing
;
120
std::string
name
;
121
unsigned
long
num
;
123
bool
dataObject
;
// trivial object? DataObject?
124
// =======================================================================
125
Node
()
126
:
clazz
( )
127
,
executing
( false )
128
,
name
( )
129
,
num
( 0 )
130
,
dataObject
( false )
131
{}
132
// ========================================================================
133
Node
(
ClassH
c
,
134
bool
e ,
135
const
std::string&
n
)
136
:
clazz
( c )
137
,
executing
( e )
138
,
name
( n )
139
,
num
( 0 )
140
,
dataObject
(
"DataObject"
== n )
141
{}
142
//
143
Node
(
const
Node
&
c
)
144
:
clazz
( c.
clazz
)
145
,
executing
( c.
executing
)
146
,
name
( c.
name
)
147
,
num
( c.
num
)
148
,
dataObject
( c.
dataObject
)
149
{}
150
// ========================================================================
151
};
152
// ==========================================================================
154
struct
Leaf
155
{
156
IAlgorithm
*
algorithm
;
157
bool
executing
;
158
std::string
name
;
159
std::string
type
;
160
unsigned
long
num
;
161
Leaf
() :
algorithm
( 0 ) ,
executing
(false ) ,
name
() ,
type
() ,
num
( 0 ) {}
162
Leaf
(
const
Leaf
&
l
)
163
:
algorithm
(l.
algorithm
),
164
executing
(l.
executing
),
name
(l.
name
),
type
(l.
type
),
num
(l.
num
) {}
165
Leaf
(
const
std::string& t,
const
std::string&
n
)
166
:
algorithm
(0),
executing
(false),
name
(n),
type
(t),
num
(0) {}
167
};
168
// ==========================================================================
169
public
:
170
// ==========================================================================
171
typedef
GaudiUtils::HashMap<Gaudi::StringKey, Node>
NodeMap
;
172
typedef
GaudiUtils::HashMap<Gaudi::StringKey, Leaf>
AlgMap
;
174
virtual
StatusCode
initialize
();
176
virtual
StatusCode
finalize
();
178
virtual
StatusCode
reinitialize
();
180
virtual
void
handle
(
const
Incident
& incident);
186
DataOnDemandSvc
187
(
const
std::string&
name
,
// Service instance name
188
ISvcLocator
* svc ) ;
// Pointer to service locator
190
virtual
~DataOnDemandSvc
();
// Standard destructor
191
// ==========================================================================
192
protected
:
193
// ==========================================================================
198
StatusCode
configureHandler
(
Leaf
& leaf);
199
// ==========================================================================
205
StatusCode
execHandler
(
const
std::string& tag,
Leaf
& leaf);
206
// ==========================================================================
212
StatusCode
execHandler
(
const
std::string& tag,
Node
& node);
213
// ==========================================================================
215
StatusCode
setupNodeHandlers
();
216
// ==========================================================================
218
StatusCode
setupAlgHandlers
();
219
// ==========================================================================
221
StatusCode
setup
();
223
void
i_setNodeHandler
(
const
std::string &
name
,
const
std::string &
type
);
225
StatusCode
i_setAlgHandler
(
const
std::string &
name
,
const
Gaudi::Utils::TypeNameString &alg);
226
// ==========================================================================
227
public
:
228
// ==========================================================================
229
void
update_1
(
Property
& p ) ;
230
void
update_2
(
Property
& p ) ;
231
void
update_3
(
Property
& p ) ;
233
void
update_dump
(
Property
&
/* p */
) ;
// update handler for 'Dump' property
234
// ==========================================================================
235
protected
:
236
// ==========================================================================
238
StatusCode
update
() ;
240
inline
MsgStream
&
stream
()
const
241
{
242
if
( 0 ==
m_log
) {
m_log
=
new
MsgStream
(
msgSvc
() ,
name
() ) ; }
243
return
*
m_log
;
244
}
249
void
dump
(
const
MSG::Level
level
,
const
bool
mode =
true
)
const
;
250
// ==========================================================================
251
private
:
252
// ==========================================================================
254
SmartIF<IIncidentSvc>
m_incSvc
;
256
SmartIF<IAlgManager>
m_algMgr
;
258
SmartIF<IDataProviderSvc>
m_dataSvc
;
260
SmartIF<IToolSvc>
m_toolSvc
;
262
std::string
m_trapType
;
264
std::string
m_dataSvcName
;
266
bool
m_partialPath
;
268
bool
m_dump
;
270
bool
m_init
;
273
bool
m_allowInitFailure
;
275
Setup
m_algMapping
;
277
Setup
m_nodeMapping
;
279
AlgMap
m_algs
;
281
NodeMap
m_nodes
;
282
//
283
typedef
std::map<std::string,std::string>
Map
;
285
Map
m_algMap
;
// { 'data' : 'algorithm' }
287
Map
m_nodeMap
;
// { 'data' : 'type' }
288
bool
m_updateRequired
;
289
std::string
m_prefix
;
290
mutable
MsgStream
*
m_log
;
291
// ==========================================================================
292
ChronoEntity
m_total
;
293
ulonglong
m_statAlg
;
294
ulonglong
m_statNode
;
295
ulonglong
m_stat
;
296
// ==========================================================================
297
ChronoEntity
m_timer_nodes
;
298
ChronoEntity
m_timer_algs
;
299
ChronoEntity
m_timer_all
;
300
bool
m_locked_nodes
;
301
bool
m_locked_algs
;
302
bool
m_locked_all
;
303
// ==========================================================================
304
std::vector<std::string>
m_nodeMapTools
;
305
std::list<IDODNodeMapper *>
m_nodeMappers
;
306
std::vector<std::string>
m_algMapTools
;
307
std::list<IDODAlgMapper *>
m_algMappers
;
308
};
309
// ============================================================================
310
311
// ============================================================================
312
// The END
313
// ============================================================================
314
#endif // GAUDISVC_DATAONDEMANDSVC_H
315
// ============================================================================
316
Generated at Wed Jun 4 2014 14:48:56 for Gaudi Framework, version v25r2 by
Doxygen
version 1.8.2 written by
Dimitri van Heesch
, © 1997-2004