| The Gaudi Framework v32r1 (f65d50dc)

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 namespace StateMachine {
12 enum State {
13 OFFLINE,
14 CONFIGURED,
15 INITIALIZED,
16 RUNNING //,
17 // FINALIZED = CONFIGURED
18 };
19
23 enum Transition {
24 CONFIGURE, // OFFLINE -> CONFIGURED
25 INITIALIZE, // CONFIGURED -> INITIALIZED
26 START, // INITIALIZED -> RUNNING
27 STOP, // RUNNING -> INITIALIZED
28 FINALIZE, // INITIALIZED -> CONFIGURED
29 TERMINATE // CONFIGURED -> OFFLINE
30 };
31
36 State GAUDI_API ChangeState( const Transition transition, const State state );
37
39 inline std::ostream& operator<<( std::ostream& s, const Gaudi::StateMachine::State& st ) {
40 switch ( st ) {
41 case Gaudi::StateMachine::OFFLINE:
42 return s << "OFFLINE";
43 case Gaudi::StateMachine::CONFIGURED:
44 return s << "CONFIGURED";
45 case Gaudi::StateMachine::INITIALIZED:
46 return s << "INITIALIZED";
47 case Gaudi::StateMachine::RUNNING:
48 return s << "RUNNING";
49 default:
50 return s;
51 }
52 }
53
55 inline std::ostream& operator<<( std::ostream& s, const Gaudi::StateMachine::Transition& t ) {
56 switch ( t ) {
57 case Gaudi::StateMachine::CONFIGURE:
58 return s << "CONFIGURE";
59 case Gaudi::StateMachine::INITIALIZE:
60 return s << "INITIALIZE";
61 case Gaudi::StateMachine::START:
62 return s << "START";
63 case Gaudi::StateMachine::STOP:
64 return s << "STOP";
65 case Gaudi::StateMachine::FINALIZE:
66 return s << "FINALIZE";
67 case Gaudi::StateMachine::TERMINATE:
68 return s << "TERMINATE";
69 default:
70 return s;
71 }
72 }
73
74 } // namespace StateMachine
75 } // namespace Gaudi
76
77 #endif /*GAUDIKERNEL_STATEMACHINE_H_*/
Gaudi::StateMachine::INITIALIZED
Definition: StateMachine.h:15
Gaudi::StateMachine::CONFIGURED
Definition: StateMachine.h:14
Gaudi::StateMachine::FINALIZE
Definition: StateMachine.h:28
Gaudi::StateMachine::operator<<
std::ostream & operator<<(std::ostream &s, const Gaudi::StateMachine::State &st)
Pretty print of states.
Definition: StateMachine.h:39
Gaudi::StateMachine::State
State
Allowed states for classes implementing the state machine (ApplicationMgr, Algorithm,...
Definition: StateMachine.h:12
Gaudi::StateMachine::CONFIGURE
Definition: StateMachine.h:24
Gaudi::StateMachine::INITIALIZE
Definition: StateMachine.h:25
GaudiException.h
compareRootHistos.state
def state
Definition: compareRootHistos.py:455
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:9
Gaudi::StateMachine::TERMINATE
Definition: StateMachine.h:29
Gaudi::StateMachine::Transition
Transition
Allowed transitions between states.
Definition: StateMachine.h:23
gaudirun.s
string s
Definition: gaudirun.py:316
Gaudi::StateMachine::START
Definition: StateMachine.h:26
Gaudi::StateMachine::OFFLINE
Definition: StateMachine.h:13
GAUDI_API
#define GAUDI_API
Definition: Kernel.h:71
std::ostream
STL class.
Gaudi
Header file for std:chrono::duration-based Counters.
Definition: __init__.py:1