CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
StatusType status() const
void setStatus(StatusType in)
bool isStuck() const
bool alreadyCalibrated() const
bool isUpdating() const
bool isReady() const
std::string statusName()
StatusType myStatus
bool isCalibrating() const
void setCalibrating()