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
ApplicationMgr
ApplicationMgr.h
Go to the documentation of this file.
1
// $Header: /tmp/svngaudi/tmp.jEpFh25751/Gaudi/GaudiSvc/src/ApplicationMgr/ApplicationMgr.h,v 1.34 2008/11/10 15:29:09 marcocle Exp $ //
2
#ifndef GAUDI_APPLICATIONMGR_H
3
#define GAUDI_APPLICATIONMGR_H
4
5
#include "
GaudiKernel/Kernel.h
"
6
#include "
GaudiKernel/IAppMgrUI.h
"
7
#include "
GaudiKernel/IEventProcessor.h
"
8
#include "
GaudiKernel/IProperty.h
"
9
#include "
GaudiKernel/IStateful.h
"
10
#include "
GaudiKernel/IComponentManager.h
"
11
#include "
GaudiKernel/IAlgorithm.h
"
12
#include "
GaudiKernel/IAlgManager.h
"
13
#include "
GaudiKernel/ISvcManager.h
"
14
#include "
GaudiKernel/Service.h
"
15
#include "
GaudiKernel/CommonMessaging.h
"
16
#include "
GaudiKernel/PropertyMgr.h
"
17
18
// STL include files
19
#include <
list
>
20
#include <
vector
>
21
22
// Forward declarations
23
class
ISvcLocator
;
24
class
ServiceManager
;
25
class
AlgorithmManager
;
26
class
DLLClassManager
;
27
28
class
IMessageSvc
;
29
class
IIncidentSvc
;
30
class
IRunable
;
31
class
IDataManagerSvc
;
32
class
IConversionSvc
;
33
class
IJobOptionsSvc
;
34
47
class
ApplicationMgr
:
public
CommonMessaging
<implements4<IAppMgrUI,
48
IEventProcessor,
49
IService,
50
IStateful> > {
51
typedef
CommonMessaging
<
implements4
<
IAppMgrUI
,
52
IEventProcessor
,
53
IService
,
54
IStateful
> >
base_class
;
55
public
:
56
typedef
std::list<std::pair<IService*,int>
>
ListSvc
;
57
typedef
std::list<std::string>
ListName
;
58
typedef
std::vector<std::string>
VectorName
;
59
60
public
:
61
62
// default creator
63
ApplicationMgr
(
IInterface
* = 0);
64
// virtual destructor
65
virtual
~ApplicationMgr
();
66
67
// implementation of IInterface::queryInterface
68
virtual
StatusCode
queryInterface
(
const
InterfaceID
& iid,
void
** pinterface);
69
70
// implementation of IAppMgrUI::run
71
virtual
StatusCode
run
();
72
// implementation of IAppMgrUI::configure
73
virtual
StatusCode
configure
();
74
// implementation of IAppMgrUI::terminate
75
virtual
StatusCode
terminate
();
76
// implementation of IAppMgrUI::initialize
77
virtual
StatusCode
initialize
();
78
// implementation of IAppMgrUI::start
79
virtual
StatusCode
start
();
80
// implementation of IAppMgrUI::stop
81
virtual
StatusCode
stop
();
82
// implementation of IAppMgrUI::finalize
83
virtual
StatusCode
finalize
();
84
// implementation of IAppMgrUI::nextEvent
85
virtual
StatusCode
nextEvent
(
int
maxevt);
86
// implementation of IAppMgrUI::name
87
virtual
const
std::string
&
name
()
const
;
89
virtual
StatusCode
executeEvent
(
void
*
par
);
91
virtual
StatusCode
executeRun
(
int
evtmax);
93
virtual
StatusCode
stopRun
();
94
95
// implementation of IStateful::state
96
virtual
Gaudi::StateMachine::State
FSMState
()
const
;
97
// implementation of IStateful::targetState
98
virtual
Gaudi::StateMachine::State
targetFSMState
()
const
;
99
// implementation of IStateful::reinitialize
100
virtual
StatusCode
reinitialize
();
101
// implementation of IStateful::reinitialize
102
virtual
StatusCode
restart
();
103
// implementation of IService::sysItinitilaize
104
virtual
StatusCode
sysInitialize
() {
return
StatusCode::SUCCESS
; }
105
// implementation of IService::sysStart
106
virtual
StatusCode
sysStart
() {
return
StatusCode::SUCCESS
; }
107
// implementation of IService::sysStop
108
virtual
StatusCode
sysStop
() {
return
StatusCode::SUCCESS
; }
109
// implementation of IService::sysFinalize
110
virtual
StatusCode
sysFinalize
() {
return
StatusCode::SUCCESS
; }
111
// implementation of IService::sysReinitialize
112
virtual
StatusCode
sysReinitialize
() {
return
StatusCode::SUCCESS
; }
113
// implementation of IService::sysRestart
114
virtual
StatusCode
sysRestart
() {
return
StatusCode::SUCCESS
; }
115
116
// SI Go Handler
117
void
SIGoHandler
(
Property
& theProp );
118
// SI Exit handler
119
void
SIExitHandler
(
Property
& theProp );
120
122
123
void
evtLoopPropertyHandler
(
Property
& theProp );
124
StatusCode
decodeExtSvcNameList
( );
125
StatusCode
decodeCreateSvcNameList
( );
126
void
createSvcNameListHandler
(
Property
&);
127
void
extSvcNameListHandler
(
Property
& theProp );
128
StatusCode
decodeMultiThreadSvcNameList
( );
129
void
multiThreadSvcNameListHandler
(
Property
& theProp );
130
StatusCode
decodeDllNameList
( );
131
void
dllNameListHandler
(
Property
& theProp );
132
void
reflexDebugPropertyHandler
(
Property
& theProp );
133
void
initLoopCheckHndlr
(
Property
& );
135
136
template
<
class
I>
137
SmartIF<IComponentManager>
&
getManager
() {
138
return
m_managers
[I::interfaceID().id()];
139
}
140
141
inline
SmartIF<ISvcManager>
&
svcManager
() {
142
// Cache the casted pointer to ISvcManager
143
if
(!
m_svcManager
) {
144
m_svcManager
= getManager<IService>();
145
}
146
return
m_svcManager
;
147
}
148
149
inline
SmartIF<IAlgManager>
&
algManager
() {
150
// Cache the casted pointer to IAlgManager
151
if
(!
m_algManager
) {
152
m_algManager
= getManager<IAlgorithm>();
153
}
154
return
m_algManager
;
155
}
156
158
virtual
SmartIF<ISvcLocator>
&
serviceLocator
()
const
{
159
return
m_svcLocator
;
160
}
161
162
protected
:
164
StatusCode
declareMultiSvcType
(
const
std::string
&
name
,
165
const
std::string
&
type
);
167
StatusCode
addMultiSvc
(
const
Gaudi::Utils::TypeNameString &
typeName
,
168
int
prio);
169
170
// implementation of IService::setServiceManager
171
void
setServiceManager
(
ISvcManager
*) {}
172
174
StatusCode
i_startup
();
175
180
StatusCode
GoToState
(
Gaudi::StateMachine::State
state
,
bool
ignoreFailures =
false
);
181
184
typedef
std::map<unsigned long, SmartIF<IComponentManager>
>
ManagersMap
;
188
ManagersMap
m_managers
;
190
StringArrayProperty
m_declaredManagers
;
191
193
SmartIF<ISvcManager>
m_svcManager
;
194
196
SmartIF<IAlgManager>
m_algManager
;
197
198
199
// data members
200
DLLClassManager
*
m_classManager
;
201
mutable
SmartIF<ISvcLocator>
m_svcLocator
;
202
203
IntegerProperty
m_SIGo
;
204
IntegerProperty
m_SIExit
;
205
StringArrayProperty
m_topAlgNameList
;
206
StringArrayProperty
m_outStreamNameList
;
207
StringProperty
m_outStreamType
;
208
StringProperty
m_messageSvcType
;
209
StringProperty
m_jobOptionsSvcType
;
210
211
212
ListSvc
m_topSvcList
;
213
ListName
m_topSvcNameList
;
214
215
std::string
m_name
;
216
Gaudi::StateMachine::State
m_state
;
217
Gaudi::StateMachine::State
m_targetState
;
218
219
VectorName
m_defServices
;
220
VectorName
m_svcMapping
;
221
VectorName
m_svcOptMapping
;
222
223
PropertyMgr
*
m_propertyMgr
;
224
SmartIF<IMessageSvc>
m_messageSvc
;
225
SmartIF<IRunable>
m_runable
;
226
SmartIF<IEventProcessor>
m_processingMgr
;
227
SmartIF<IJobOptionsSvc>
m_jobOptionsSvc
;
228
229
//
230
// The public ApplicationMgr properties
231
//
232
233
int
m_evtMax
;
234
StringArrayProperty
m_extSvcNameList
;
235
BooleanProperty
m_extSvcCreates
;
236
238
StringArrayProperty
m_multiThreadSvcNameList
;
239
int
m_noOfEvtThreads
;
240
241
StringArrayProperty
m_dllNameList
;
242
std::string
m_jobOptionsType
;
243
std::string
m_jobOptionsPath
;
244
std::string
m_runableType
;
245
std::string
m_eventLoopMgr
;
246
std::string
m_evtsel
;
247
std::string
m_histPersName
;
248
int
m_outputLevel
;
249
std::string
m_appName
;
250
std::string
m_appVersion
;
251
bool
m_actHistory
;
252
bool
m_codeCheck
;
253
IntegerProperty
m_reflexDebugLevel
;
254
255
StringArrayProperty
m_createSvcNameList
;
256
258
BooleanProperty
m_auditTools
;
259
BooleanProperty
m_auditSvcs
;
260
BooleanProperty
m_auditAlgs
;
261
262
std::map<std::string,std::string>
m_environment
;
263
265
BooleanProperty
m_loopCheck
;
266
269
BooleanProperty
m_stopOnSignal
;
270
273
BooleanProperty
m_stalledEventMonitoring
;
274
275
// Flag to activate the printout of properties
276
bool
m_propertiesPrint
;
277
279
IntegerProperty
m_returnCode
;
280
281
private
:
282
std::vector<std::string>
m_okDlls
;
283
};
284
#endif // GAUDI_APPLICATIONMGR_H
Generated at Wed Nov 28 2012 12:17:11 for Gaudi Framework, version v23r5 by
Doxygen
version 1.8.2 written by
Dimitri van Heesch
, © 1997-2004