CMS 3D CMS Logo

TkStateMachine.h
Go to the documentation of this file.
1 #ifndef Tracker_TkFiniteStateMachine_h
2 #define Tracker_TkFiniteStateMachine_h
3 
4 #include <string>
13 public:
14  enum StatusType { ready = 1, calibrating = 2, updating = 3, stuck = 4 };
15 
16  bool alreadyCalibrated() const { return (myStatus == updating || myStatus == ready); }
17  StatusType status() const { return myStatus; }
18 
19  void setReady() { myStatus = ready; }
22  void setStuck() { myStatus = stuck; }
23 
25 
26  bool isReady() const { return myStatus == ready; }
27  bool isStuck() const { return myStatus == stuck; }
28  bool isUpdating() const { return myStatus == updating; }
29  bool isCalibrating() const { return myStatus == calibrating; }
30 
32  if (myStatus == ready)
33  return "Ready";
34  if (myStatus == calibrating)
35  return "Calibrating";
36  if (myStatus == updating)
37  return "Updating";
38  if (myStatus == stuck)
39  return "Stuck";
40  return "Unknown Status";
41  }
42 
43 public:
45 };
46 
47 #endif
TkStateMachine::status
StatusType status() const
Definition: TkStateMachine.h:17
TkStateMachine
Definition: TkStateMachine.h:12
TkStateMachine::setUpdating
void setUpdating()
Definition: TkStateMachine.h:20
TkStateMachine::alreadyCalibrated
bool alreadyCalibrated() const
Definition: TkStateMachine.h:16
TkStateMachine::myStatus
StatusType myStatus
Definition: TkStateMachine.h:44
TkStateMachine::stuck
Definition: TkStateMachine.h:14
TkStateMachine::StatusType
StatusType
Definition: TkStateMachine.h:14
TkStateMachine::setReady
void setReady()
Definition: TkStateMachine.h:19
TkStateMachine::isReady
bool isReady() const
Definition: TkStateMachine.h:26
TkStateMachine::isStuck
bool isStuck() const
Definition: TkStateMachine.h:27
TkStateMachine::setStatus
void setStatus(StatusType in)
Definition: TkStateMachine.h:24
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
TkStateMachine::isCalibrating
bool isCalibrating() const
Definition: TkStateMachine.h:29
TkStateMachine::calibrating
Definition: TkStateMachine.h:14
recoMuon::in
Definition: RecoMuonEnumerators.h:6
TkStateMachine::setStuck
void setStuck()
Definition: TkStateMachine.h:22
TkStateMachine::isUpdating
bool isUpdating() const
Definition: TkStateMachine.h:28
TkStateMachine::ready
Definition: TkStateMachine.h:14
TkStateMachine::setCalibrating
void setCalibrating()
Definition: TkStateMachine.h:21
TkStateMachine::updating
Definition: TkStateMachine.h:14
TkStateMachine::statusName
std::string statusName()
Definition: TkStateMachine.h:31