The Gaudi Framework
master (37c0b60a)
StateMachine.h
Go to the documentation of this file.
1
/***********************************************************************************\
2
* (c) Copyright 1998-2024 CERN for the benefit of the LHCb and ATLAS collaborations *
3
* *
4
* This software is distributed under the terms of the Apache version 2 licence, *
5
* copied verbatim in the file "LICENSE". *
6
* *
7
* In applying this licence, CERN does not waive the privileges and immunities *
8
* granted to it by virtue of its status as an Intergovernmental Organization *
9
* or submit itself to any jurisdiction. *
10
\***********************************************************************************/
11
#ifndef GAUDIKERNEL_STATEMACHINE_H_
12
#define GAUDIKERNEL_STATEMACHINE_H_
13
14
#include <
GaudiKernel/GaudiException.h
>
15
16
namespace
Gaudi
{
17
namespace
StateMachine {
22
enum
State
{
23
OFFLINE
,
24
CONFIGURED
,
25
INITIALIZED
,
26
RUNNING
//,
27
// FINALIZED = CONFIGURED
28
};
29
33
enum
Transition
{
34
CONFIGURE
,
// OFFLINE -> CONFIGURED
35
INITIALIZE
,
// CONFIGURED -> INITIALIZED
36
START
,
// INITIALIZED -> RUNNING
37
STOP
,
// RUNNING -> INITIALIZED
38
FINALIZE
,
// INITIALIZED -> CONFIGURED
39
TERMINATE
// CONFIGURED -> OFFLINE
40
};
41
46
State
GAUDI_API
ChangeState
(
const
Transition
transition,
const
State
state
);
47
49
inline
std::ostream
&
operator<<
(
std::ostream
&
s
,
const
Gaudi::StateMachine::State
& st ) {
50
switch
( st ) {
51
case
Gaudi::StateMachine::OFFLINE
:
52
return
s
<<
"OFFLINE"
;
53
case
Gaudi::StateMachine::CONFIGURED
:
54
return
s
<<
"CONFIGURED"
;
55
case
Gaudi::StateMachine::INITIALIZED
:
56
return
s
<<
"INITIALIZED"
;
57
case
Gaudi::StateMachine::RUNNING
:
58
return
s
<<
"RUNNING"
;
59
default
:
60
return
s
;
61
}
62
}
63
65
inline
std::ostream
&
operator<<
(
std::ostream
&
s
,
const
Gaudi::StateMachine::Transition
&
t
) {
66
switch
(
t
) {
67
case
Gaudi::StateMachine::CONFIGURE
:
68
return
s
<<
"CONFIGURE"
;
69
case
Gaudi::StateMachine::INITIALIZE
:
70
return
s
<<
"INITIALIZE"
;
71
case
Gaudi::StateMachine::START
:
72
return
s
<<
"START"
;
73
case
Gaudi::StateMachine::STOP
:
74
return
s
<<
"STOP"
;
75
case
Gaudi::StateMachine::FINALIZE
:
76
return
s
<<
"FINALIZE"
;
77
case
Gaudi::StateMachine::TERMINATE
:
78
return
s
<<
"TERMINATE"
;
79
default
:
80
return
s
;
81
}
82
}
83
84
}
// namespace StateMachine
85
}
// namespace Gaudi
86
87
#endif
/*GAUDIKERNEL_STATEMACHINE_H_*/
Gaudi::StateMachine::TERMINATE
@ TERMINATE
Definition:
StateMachine.h:39
GaudiException.h
gaudirun.s
string s
Definition:
gaudirun.py:346
Gaudi::StateMachine::FINALIZE
@ FINALIZE
Definition:
StateMachine.h:38
Gaudi::StateMachine::operator<<
std::ostream & operator<<(std::ostream &s, const Gaudi::StateMachine::State &st)
Pretty print of states.
Definition:
StateMachine.h:49
Gaudi::StateMachine::INITIALIZE
@ INITIALIZE
Definition:
StateMachine.h:35
bug_34121.t
t
Definition:
bug_34121.py:31
Gaudi::StateMachine::State
State
Allowed states for classes implementing the state machine (ApplicationMgr, Algorithm,...
Definition:
StateMachine.h:22
Gaudi::StateMachine::CONFIGURED
@ CONFIGURED
Definition:
StateMachine.h:24
std::ostream
STL class.
Gaudi::StateMachine::OFFLINE
@ OFFLINE
Definition:
StateMachine.h:23
Gaudi::StateMachine::RUNNING
@ RUNNING
Definition:
StateMachine.h:26
Gaudi
This file provides a Grammar for the type Gaudi::Accumulators::Axis It allows to use that type from p...
Definition:
__init__.py:1
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:19
Gaudi::StateMachine::Transition
Transition
Allowed transitions between states.
Definition:
StateMachine.h:33
Gaudi::StateMachine::INITIALIZED
@ INITIALIZED
Definition:
StateMachine.h:25
Gaudi::StateMachine::START
@ START
Definition:
StateMachine.h:36
compareRootHistos.state
state
Definition:
compareRootHistos.py:496
Gaudi::StateMachine::CONFIGURE
@ CONFIGURE
Definition:
StateMachine.h:34
GAUDI_API
#define GAUDI_API
Definition:
Kernel.h:81
Gaudi::StateMachine::STOP
@ STOP
Definition:
StateMachine.h:37
GaudiKernel
include
GaudiKernel
StateMachine.h
Generated on Thu Dec 19 2024 15:35:02 for The Gaudi Framework by
1.8.18