Belle II Software development
RCState Class Reference
Inheritance diagram for RCState:
NSMState Enum

Public Member Functions

 RCState (const Enum &e)
 
 RCState (const NSMState &num)
 
 RCState (const RCState &st)
 
 RCState (const char *st)
 
 RCState (const std::string &st)
 
 RCState (int id)
 
bool isStable () const
 
bool isTransition () const
 
bool isError () const
 
bool isRecovering () const
 
RCState next () const
 
const RCStateoperator= (const RCState &state)
 Operator =.
 
const RCStateoperator= (const std::string &msg)
 
const RCStateoperator= (const char *msg)
 
const RCStateoperator= (int id)
 
int getId () const
 
const char * getLabel () const
 
const std::string & getLabelString () const
 
bool operator== (const Enum &e) const
 
bool operator== (const std::string &label) const
 
bool operator!= (const Enum &e) const
 
bool operator!= (const std::string &label) const
 

Static Public Attributes

static const RCState OFF_S
 
static const RCState NOTREADY_S
 
static const RCState READY_S
 
static const RCState RUNNING_S
 
static const RCState PAUSED_S
 
static const RCState CONFIGURING_TS
 
static const RCState LOADING_TS
 
static const RCState STARTING_TS
 
static const RCState STOPPING_TS
 
static const RCState ERROR_ES
 
static const RCState FATAL_ES
 
static const RCState RECOVERING_RS
 
static const RCState ABORTING_RS
 
static const RCState BOOTING_RS
 
static const NSMState ONLINE_S
 
static const Enum UNKNOWN
 

Protected Member Functions

 RCState (int id, const char *label)
 

Private Attributes

int m_id
 
std::string m_label
 

Detailed Description

Definition at line 19 of file RCState.h.

Constructor & Destructor Documentation

◆ RCState() [1/8]

RCState ( )
inline

Definition at line 38 of file RCState.h.

38: NSMState(Enum::UNKNOWN) {}

◆ RCState() [2/8]

RCState ( const Enum e)
inline

Definition at line 39 of file RCState.h.

39: NSMState(e) {}

◆ RCState() [3/8]

RCState ( const NSMState num)
inline

Definition at line 40 of file RCState.h.

40: NSMState(num) {}

◆ RCState() [4/8]

RCState ( const RCState st)
inline

Definition at line 41 of file RCState.h.

41: NSMState(st) {}

◆ RCState() [5/8]

RCState ( const char *  st)
inline

Definition at line 42 of file RCState.h.

42{ *this = st; }

◆ RCState() [6/8]

RCState ( const std::string &  st)
inline

Definition at line 43 of file RCState.h.

43{ *this = st; }

◆ RCState() [7/8]

RCState ( int  id)
inline

Definition at line 44 of file RCState.h.

44{ *this = id; }

◆ ~RCState()

~RCState ( )
inline

Definition at line 45 of file RCState.h.

45{}

◆ RCState() [8/8]

RCState ( int  id,
const char *  label 
)
inlineprotected

Definition at line 48 of file RCState.h.

49 : NSMState(id, label) {}

Member Function Documentation

◆ getId()

int getId ( ) const
inlineinherited

Definition at line 34 of file Enum.h.

34{ return m_id; }

◆ getLabel()

const char * getLabel ( ) const
inlineinherited

Definition at line 35 of file Enum.h.

35{ return m_label.c_str(); }

◆ getLabelString()

const std::string & getLabelString ( ) const
inlineinherited

Definition at line 36 of file Enum.h.

36{ return m_label; }

◆ isError()

bool isError ( ) const
inline

Definition at line 54 of file RCState.h.

54{ return getId() > 9 && getId() <= 11; }

◆ isRecovering()

bool isRecovering ( ) const
inline

Definition at line 55 of file RCState.h.

55{ return getId() > 11 && getId() <= 14; }

◆ isStable()

bool isStable ( ) const
inline

Definition at line 52 of file RCState.h.

52{ return getId() > 1 && getId() <= 5; }

◆ isTransition()

bool isTransition ( ) const
inline

Definition at line 53 of file RCState.h.

53{ return getId() > 5 && getId() <= 9; }

◆ next()

RCState next ( ) const

Definition at line 78 of file RCState.cc.

79{
80 if (*this == LOADING_TS) return READY_S;
81 else if (*this == STARTING_TS) return RUNNING_S;
82 else if (*this == STOPPING_TS) return READY_S;
83 else if (*this == RECOVERING_RS) return READY_S;
84 else if (*this == ABORTING_RS) return NOTREADY_S;
85 else if (*this == BOOTING_RS) return NOTREADY_S;
86 else if (*this == CONFIGURING_TS) return NOTREADY_S;
87 else return Enum::UNKNOWN;
88}

◆ operator=() [1/4]

const RCState & operator= ( const char *  msg)

Definition at line 52 of file RCState.cc.

53{
54 if (label != NULL) *this = std::string(label);
55 else *this = Enum::UNKNOWN;
56 return *this;
57}

◆ operator=() [2/4]

const RCState & operator= ( const RCState state)

Operator =.

Definition at line 27 of file RCState.cc.

28{
30 return *this;
31}
const NSMState & operator=(const NSMState &state)
Operator =.
Definition: NSMState.cc:14

◆ operator=() [3/4]

const RCState & operator= ( const std::string &  msg)

Definition at line 33 of file RCState.cc.

34{
35 if (label == NOTREADY_S.getLabel()) *this = NOTREADY_S;
36 else if (label == READY_S.getLabel()) *this = READY_S;
37 else if (label == RUNNING_S.getLabel()) *this = RUNNING_S;
38 else if (label == PAUSED_S.getLabel()) *this = PAUSED_S;
39 else if (label == LOADING_TS.getLabel()) *this = LOADING_TS;
40 else if (label == STARTING_TS.getLabel()) *this = STARTING_TS;
41 else if (label == STOPPING_TS.getLabel()) *this = STOPPING_TS;
42 else if (label == CONFIGURING_TS.getLabel()) *this = CONFIGURING_TS;
43 else if (label == ERROR_ES.getLabel()) *this = ERROR_ES;
44 else if (label == FATAL_ES.getLabel()) *this = FATAL_ES;
45 else if (label == RECOVERING_RS.getLabel()) *this = RECOVERING_RS;
46 else if (label == ABORTING_RS.getLabel()) *this = ABORTING_RS;
47 else if (label == BOOTING_RS.getLabel()) *this = BOOTING_RS;
48 else *this = Enum::UNKNOWN;
49 return *this;
50}

◆ operator=() [4/4]

const RCState & operator= ( int  id)

Definition at line 59 of file RCState.cc.

60{
61 if (id == NOTREADY_S.getId()) *this = NOTREADY_S;
62 else if (id == READY_S.getId()) *this = READY_S;
63 else if (id == RUNNING_S.getId()) *this = RUNNING_S;
64 else if (id == PAUSED_S.getId()) *this = PAUSED_S;
65 else if (id == LOADING_TS.getId()) *this = LOADING_TS;
66 else if (id == STARTING_TS.getId()) *this = STARTING_TS;
67 else if (id == STOPPING_TS.getId()) *this = STOPPING_TS;
68 else if (id == CONFIGURING_TS.getId()) *this = CONFIGURING_TS;
69 else if (id == ERROR_ES.getId()) *this = ERROR_ES;
70 else if (id == FATAL_ES.getId()) *this = FATAL_ES;
71 else if (id == RECOVERING_RS.getId()) *this = RECOVERING_RS;
72 else if (id == ABORTING_RS.getId()) *this = ABORTING_RS;
73 else if (id == BOOTING_RS.getId()) *this = BOOTING_RS;
74 else *this = Enum::UNKNOWN;
75 return *this;
76}

Member Data Documentation

◆ ABORTING_RS

const RCState ABORTING_RS
static

Definition at line 34 of file RCState.h.

◆ BOOTING_RS

const RCState BOOTING_RS
static

Definition at line 35 of file RCState.h.

◆ CONFIGURING_TS

const RCState CONFIGURING_TS
static

Definition at line 27 of file RCState.h.

◆ ERROR_ES

const RCState ERROR_ES
static

Definition at line 31 of file RCState.h.

◆ FATAL_ES

const RCState FATAL_ES
static

Definition at line 32 of file RCState.h.

◆ LOADING_TS

const RCState LOADING_TS
static

Definition at line 28 of file RCState.h.

◆ m_id

int m_id
privateinherited

Definition at line 45 of file Enum.h.

◆ m_label

std::string m_label
privateinherited

Definition at line 46 of file Enum.h.

◆ NOTREADY_S

const RCState NOTREADY_S
static

Definition at line 23 of file RCState.h.

◆ OFF_S

const RCState OFF_S
static

Definition at line 22 of file RCState.h.

◆ ONLINE_S

const NSMState ONLINE_S
staticinherited

Definition at line 22 of file NSMState.h.

◆ PAUSED_S

const RCState PAUSED_S
static

Definition at line 26 of file RCState.h.

◆ READY_S

const RCState READY_S
static

Definition at line 24 of file RCState.h.

◆ RECOVERING_RS

const RCState RECOVERING_RS
static

Definition at line 33 of file RCState.h.

◆ RUNNING_S

const RCState RUNNING_S
static

Definition at line 25 of file RCState.h.

◆ STARTING_TS

const RCState STARTING_TS
static

Definition at line 29 of file RCState.h.

◆ STOPPING_TS

const RCState STOPPING_TS
static

Definition at line 30 of file RCState.h.

◆ UNKNOWN

const Enum UNKNOWN
staticinherited

Definition at line 22 of file Enum.h.


The documentation for this class was generated from the following files: