File indexing completed on 2025-01-18 09:57:43
0001
0002
0003
0004
0005
0006
0007
0008
0009
0010
0011 #ifndef GAUDIKERNEL_STATEMACHINE_H_
0012 #define GAUDIKERNEL_STATEMACHINE_H_
0013
0014 #include "GaudiKernel/GaudiException.h"
0015
0016 namespace Gaudi {
0017 namespace StateMachine {
0018
0019
0020
0021
0022 enum State {
0023 OFFLINE,
0024 CONFIGURED,
0025 INITIALIZED,
0026 RUNNING
0027
0028 };
0029
0030
0031
0032
0033 enum Transition {
0034 CONFIGURE,
0035 INITIALIZE,
0036 START,
0037 STOP,
0038 FINALIZE,
0039 TERMINATE
0040 };
0041
0042
0043
0044
0045
0046 State GAUDI_API ChangeState( const Transition transition, const State state );
0047
0048
0049 inline std::ostream& operator<<( std::ostream& s, const Gaudi::StateMachine::State& st ) {
0050 switch ( st ) {
0051 case Gaudi::StateMachine::OFFLINE:
0052 return s << "OFFLINE";
0053 case Gaudi::StateMachine::CONFIGURED:
0054 return s << "CONFIGURED";
0055 case Gaudi::StateMachine::INITIALIZED:
0056 return s << "INITIALIZED";
0057 case Gaudi::StateMachine::RUNNING:
0058 return s << "RUNNING";
0059 default:
0060 return s;
0061 }
0062 }
0063
0064
0065 inline std::ostream& operator<<( std::ostream& s, const Gaudi::StateMachine::Transition& t ) {
0066 switch ( t ) {
0067 case Gaudi::StateMachine::CONFIGURE:
0068 return s << "CONFIGURE";
0069 case Gaudi::StateMachine::INITIALIZE:
0070 return s << "INITIALIZE";
0071 case Gaudi::StateMachine::START:
0072 return s << "START";
0073 case Gaudi::StateMachine::STOP:
0074 return s << "STOP";
0075 case Gaudi::StateMachine::FINALIZE:
0076 return s << "FINALIZE";
0077 case Gaudi::StateMachine::TERMINATE:
0078 return s << "TERMINATE";
0079 default:
0080 return s;
0081 }
0082 }
0083
0084 }
0085 }
0086
0087 #endif