| The Gaudi Framework v29r0 (ff2e7097)

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

- File List
- File Members

StateMachine.h
Go to the documentation of this file.
1 #ifndef GAUDIKERNEL_STATEMACHINE_H_
2 #define GAUDIKERNEL_STATEMACHINE_H_
3
4 #include "GaudiKernel/GaudiException.h"
5
6 namespace Gaudi
7 {
8 namespace StateMachine
9 {
14 enum State {
15 OFFLINE,
16 CONFIGURED,
17 INITIALIZED,
18 RUNNING //,
19 // FINALIZED = CONFIGURED
20 };
21
25 enum Transition {
26 CONFIGURE, // OFFLINE -> CONFIGURED
27 INITIALIZE, // CONFIGURED -> INITIALIZED
28 START, // INITIALIZED -> RUNNING
29 STOP, // RUNNING -> INITIALIZED
30 FINALIZE, // INITIALIZED -> CONFIGURED
31 TERMINATE // CONFIGURED -> OFFLINE
32 };
33
38 State GAUDI_API ChangeState( const Transition transition, const State state );
39
41 inline std::ostream& operator<<( std::ostream& s, const Gaudi::StateMachine::State& st )
42 {
43 switch ( st ) {
44 case Gaudi::StateMachine::OFFLINE:
45 return s << "OFFLINE";
46 case Gaudi::StateMachine::CONFIGURED:
47 return s << "CONFIGURED";
48 case Gaudi::StateMachine::INITIALIZED:
49 return s << "INITIALIZED";
50 case Gaudi::StateMachine::RUNNING:
51 return s << "RUNNING";
52 }
53 return s; // cannot be reached, but make the compiler happy
54 }
55
57 inline std::ostream& operator<<( std::ostream& s, const Gaudi::StateMachine::Transition& t )
58 {
59 switch ( t ) {
60 case Gaudi::StateMachine::CONFIGURE:
61 return s << "CONFIGURE";
62 case Gaudi::StateMachine::INITIALIZE:
63 return s << "INITIALIZE";
64 case Gaudi::StateMachine::START:
65 return s << "START";
66 case Gaudi::StateMachine::STOP:
67 return s << "STOP";
68 case Gaudi::StateMachine::FINALIZE:
69 return s << "FINALIZE";
70 case Gaudi::StateMachine::TERMINATE:
71 return s << "TERMINATE";
72 }
73 return s; // cannot be reached, but make the compiler happy
74 }
75
76 } // namespace StateMachine
77 } // namespace Gaudi
78
79 #endif /*GAUDIKERNEL_STATEMACHINE_H_*/
Gaudi::StateMachine::INITIALIZED
Definition: StateMachine.h:17
Gaudi::StateMachine::CONFIGURED
Definition: StateMachine.h:16
compareRootHistos.state
state
Definition: compareRootHistos.py:422
Gaudi::StateMachine::FINALIZE
Definition: StateMachine.h:30
Gaudi::StateMachine::operator<<
std::ostream & operator<<(std::ostream &s, const Gaudi::StateMachine::State &st)
Pretty print of states.
Definition: StateMachine.h:41
Gaudi::StateMachine::State
State
Allowed states for classes implementing the state machine (ApplicationMgr, Algorithm, Service, AlgTool).
Definition: StateMachine.h:14
Gaudi::StateMachine::CONFIGURE
Definition: StateMachine.h:26
Gaudi::StateMachine::INITIALIZE
Definition: StateMachine.h:27
GaudiException.h
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
gaudirun.s
string s
Definition: gaudirun.py:253
Gaudi::StateMachine::START
Definition: StateMachine.h:28
Gaudi::StateMachine::OFFLINE
Definition: StateMachine.h:15
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:110
std::ostream
STL class.
Gaudi
Helper functions to set/get the application return code.
Definition: __init__.py:1