Loading [MathJax]/extensions/tex2jax.js
The Gaudi Framework  v31r0 (aeb156f0)
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
StateMachine.h
Go to the documentation of this file.
1 #ifndef GAUDIKERNEL_STATEMACHINE_H_
2 #define GAUDIKERNEL_STATEMACHINE_H_
3 
5 
6 namespace Gaudi {
7  namespace StateMachine {
12  enum State {
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 
40  switch ( st ) {
42  return s << "OFFLINE";
44  return s << "CONFIGURED";
46  return s << "INITIALIZED";
48  return s << "RUNNING";
49  default:
50  return s;
51  }
52  }
53 
56  switch ( t ) {
58  return s << "CONFIGURE";
60  return s << "INITIALIZE";
62  return s << "START";
64  return s << "STOP";
66  return s << "FINALIZE";
68  return s << "TERMINATE";
69  default:
70  return s;
71  }
72  }
73 
74  } // namespace StateMachine
75 } // namespace Gaudi
76 
77 #endif /*GAUDIKERNEL_STATEMACHINE_H_*/
std::ostream & operator<<(std::ostream &s, const Gaudi::StateMachine::State &st)
Pretty print of states.
Definition: StateMachine.h:39
State
Allowed states for classes implementing the state machine (ApplicationMgr, Algorithm, Service, AlgTool).
Definition: StateMachine.h:12
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
Transition
Allowed transitions between states.
Definition: StateMachine.h:23
string s
Definition: gaudirun.py:312
#define GAUDI_API
Definition: Kernel.h:71
STL class.
Helper functions to set/get the application return code.
Definition: __init__.py:1