The Gaudi Framework
v28r2
Main Page
Related Pages
Modules
Namespaces
Classes
Files
File List
File Members
•
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Properties
Friends
Macros
Modules
Pages
StateMachine.cpp
Go to the documentation of this file.
1
#include "
GaudiKernel/StateMachine.h
"
2
3
namespace
Gaudi
{
namespace
StateMachine {
8
State
ChangeState
(
const
Transition
transition,
const
State
state
) {
9
switch
(transition) {
10
case
CONFIGURE
:
11
if
(
OFFLINE
== state ) {
12
return
CONFIGURED
;
13
}
14
break
;
15
case
INITIALIZE
:
16
if
(
CONFIGURED
== state ) {
17
return
INITIALIZED
;
18
}
19
break
;
20
case
START
:
21
if
(
INITIALIZED
== state ) {
22
return
RUNNING
;
23
}
24
break
;
25
case
STOP
:
26
if
(
RUNNING
== state ) {
27
return
INITIALIZED
;
28
}
29
break
;
30
case
FINALIZE
:
31
if
(
INITIALIZED
== state ) {
32
return
CONFIGURED
;
33
}
34
break
;
35
case
TERMINATE
:
36
if
(
CONFIGURED
== state ) {
37
return
OFFLINE
;
38
}
39
break
;
40
}
41
std::stringstream
msg
;
42
msg <<
"Invalid transition '"
<< transition <<
"' from state '"
<< state <<
"'"
;
43
throw
GaudiException
(msg.
str
(),
"Gaudi::StateMachine::ChangeState"
,
44
StatusCode
(
StatusCode::FAILURE
,
true
));
45
return
OFFLINE
;
// never reached, but maked the compiler happy
46
}
47
48
} }
// namespace Gaudi::StateMachine
Gaudi::StateMachine::INITIALIZED
Definition:
StateMachine.h:15
GaudiException
Define general base for Gaudi exception.
Definition:
GaudiException.h:23
Gaudi::StateMachine::CONFIGURED
Definition:
StateMachine.h:14
StatusCode::FAILURE
Definition:
StatusCode.h:29
compareRootHistos.state
state
Definition:
compareRootHistos.py:348
Gaudi::StateMachine::FINALIZE
Definition:
StateMachine.h:28
Gaudi::StateMachine::State
State
Allowed states for classes implementing the state machine (ApplicationMgr, Algorithm, Service, AlgTool).
Definition:
StateMachine.h:12
std::stringstream
STL class.
Gaudi::StateMachine::CONFIGURE
Definition:
StateMachine.h:24
Gaudi::StateMachine::INITIALIZE
Definition:
StateMachine.h:25
StatusCode
This class is used for returning status codes from appropriate routines.
Definition:
StatusCode.h:26
std::stringstream::str
T str(T...args)
Gaudi::StateMachine::STOP
Definition:
StateMachine.h:27
Gaudi::StateMachine::RUNNING
Definition:
StateMachine.h:16
Gaudi::StateMachine::ChangeState
State GAUDI_API ChangeState(const Transition transition, const State state)
Function to get the new state according to the required transition, checking if the transition is all...
Definition:
StateMachine.cpp:8
Gaudi::StateMachine::TERMINATE
Definition:
StateMachine.h:29
Gaudi::StateMachine::Transition
Transition
Allowed transitions between states.
Definition:
StateMachine.h:23
GaudiMP.FdsRegistry.msg
msg
Definition:
FdsRegistry.py:8
Gaudi::StateMachine::START
Definition:
StateMachine.h:26
Gaudi::StateMachine::OFFLINE
Definition:
StateMachine.h:13
StateMachine.h
Gaudi
Helper functions to set/get the application return code.
Definition:
__init__.py:1
GaudiKernel
src
Lib
StateMachine.cpp
Generated on Thu Mar 30 2017 15:42:55 for The Gaudi Framework by
1.8.11