The Gaudi Framework
v26r1
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
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
GaudiKernel
src
Lib
StateMachine.cpp
Generated on Mon Feb 16 2015 11:56:56 for The Gaudi Framework by
1.8.2