| The Gaudi Framework v29r0 (ff2e7097)

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

StateMachine.cpp
Go to the documentation of this file.
1 #include "GaudiKernel/StateMachine.h"
2
3 namespace Gaudi
4 {
5 namespace StateMachine
6 {
11 State ChangeState( const Transition transition, const State state )
12 {
13 switch ( transition ) {
14 case CONFIGURE:
15 if ( OFFLINE == state ) {
16 return CONFIGURED;
17 }
18 break;
19 case INITIALIZE:
20 if ( CONFIGURED == state ) {
21 return INITIALIZED;
22 }
23 break;
24 case START:
25 if ( INITIALIZED == state ) {
26 return RUNNING;
27 }
28 break;
29 case STOP:
30 if ( RUNNING == state ) {
31 return INITIALIZED;
32 }
33 break;
34 case FINALIZE:
35 if ( INITIALIZED == state ) {
36 return CONFIGURED;
37 }
38 break;
39 case TERMINATE:
40 if ( CONFIGURED == state ) {
41 return OFFLINE;
42 }
43 break;
44 }
45 std::stringstream msg;
46 msg << "Invalid transition '" << transition << "' from state '" << state << "'";
47 throw GaudiException( msg.str(), "Gaudi::StateMachine::ChangeState", StatusCode( StatusCode::FAILURE, true ) );
48 return OFFLINE; // never reached, but maked the compiler happy
49 }
50 }
51 } // namespace Gaudi::StateMachine
Gaudi::StateMachine::INITIALIZED
Definition: StateMachine.h:17
GaudiException
Define general base for Gaudi exception.
Definition: GaudiException.h:22
Gaudi::StateMachine::CONFIGURED
Definition: StateMachine.h:16
StatusCode::FAILURE
Definition: StatusCode.h:31
compareRootHistos.state
state
Definition: compareRootHistos.py:422
Gaudi::StateMachine::FINALIZE
Definition: StateMachine.h:30
Gaudi::StateMachine::State
State
Allowed states for classes implementing the state machine (ApplicationMgr, Algorithm, Service, AlgTool).
Definition: StateMachine.h:14
std::stringstream
STL class.
Gaudi::StateMachine::CONFIGURE
Definition: StateMachine.h:26
Gaudi::StateMachine::INITIALIZE
Definition: StateMachine.h:27
StatusCode
This class is used for returning status codes from appropriate routines.
Definition: StatusCode.h:28
std::stringstream::str
T str(T...args)
Gaudi::StateMachine::STOP
Definition: StateMachine.h:29
Gaudi::StateMachine::RUNNING
Definition: StateMachine.h:18
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:11
Gaudi::StateMachine::TERMINATE
Definition: StateMachine.h:31
Gaudi::StateMachine::Transition
Transition
Allowed transitions between states.
Definition: StateMachine.h:25
GaudiMP.FdsRegistry.msg
msg
Definition: FdsRegistry.py:8
Gaudi::StateMachine::START
Definition: StateMachine.h:28
Gaudi::StateMachine::OFFLINE
Definition: StateMachine.h:15
StateMachine.h
Gaudi
Helper functions to set/get the application return code.
Definition: __init__.py:1