Belle II Software  release-05-02-19
RCState.h
1 #ifndef _Belle2_RCState_hh
2 #define _Belle2_RCState_hh
3 
4 #include <daq/slc/nsm/NSMState.h>
5 
6 namespace Belle2 {
12  class RCState : public NSMState {
13 
14  public:
15  static const RCState OFF_S;
16  static const RCState NOTREADY_S;
17  static const RCState READY_S;
18  static const RCState RUNNING_S;
19  static const RCState PAUSED_S;
20  static const RCState CONFIGURING_TS;
21  static const RCState LOADING_TS;
22  static const RCState STARTING_TS;
23  static const RCState STOPPING_TS;
24  static const RCState ERROR_ES;
25  static const RCState FATAL_ES;
26  static const RCState RECOVERING_RS;
27  static const RCState ABORTING_RS;
28  static const RCState BOOTING_RS;
29 
30  public:
31  RCState() : NSMState(Enum::UNKNOWN) {}
32  RCState(const Enum& e) : NSMState(e) {}
33  RCState(const NSMState& num) : NSMState(num) {}
34  RCState(const RCState& st) : NSMState(st) {}
35  RCState(const char* st) { *this = st; }
36  RCState(const std::string& st) { *this = st; }
37  RCState(int id) { *this = id; }
38  ~RCState() {}
39 
40  protected:
41  RCState(int id, const char* label)
42  : NSMState(id, label) {}
43 
44  public:
45  bool isStable() const { return getId() > 1 && getId() <= 5; }
46  bool isTransition() const { return getId() > 5 && getId() <= 9; }
47  bool isError() const { return getId() > 9 && getId() <= 11; }
48  bool isRecovering() const { return getId() > 11 && getId() <= 14; }
49  RCState next() const;
50 
51  public:
52  const RCState& operator=(const std::string& msg);
53  const RCState& operator=(const char* msg);
54  const RCState& operator=(int id);
55 
56  };
57 
59 }
60 
61 #endif
Belle2::NSMState
Definition: NSMState.h:12
Belle2::Enum
Definition: Enum.h:12
Belle2
Abstract base class for different kinds of events.
Definition: MillepedeAlgorithm.h:19
Belle2::RCState
Definition: RCState.h:12