INTRODUCTION Overview Download and Install Quick Start Documentation Publications NONFRAMEWORK CODE Driver Interfaces Drivers Libraries Utilities FRAMEWORK CODE Interfaces Components Libraries Utilities Full Software Listings DEVELOPER Tutorials Examples Dev Guide Dashboard PEOPLE Contributors Users Project Download Mailing lists
|
statemachine.h00001 #ifndef HYDROROBOTDRIVERUTIL_STATEMACHINE_H 00002 #define HYDROROBOTDRIVERUTIL_STATEMACHINE_H 00003 00004 #include <string> 00005 #include <gbxsickacfr/gbxiceutilacfr/store.h> 00006 00007 namespace hydrorobotdriverutil { 00008 00014 class StateMachine 00015 { 00016 00017 public: 00018 00020 StateMachine(); 00021 00022 void setWarning( const std::string &reason ); 00023 void setFault( const std::string &reason ); 00024 void setOK(); 00025 bool isFault(); 00026 bool isFault( std::string &reason ); 00027 bool isWarning(); 00028 bool isWarning( std::string &reason ); 00029 bool isWarnOrFault(); 00030 00031 private: 00032 00034 enum StateType { 00035 StateTypeOK, 00036 StateTypeWarning, 00037 StateTypeFault 00038 }; 00039 class State { 00040 public: 00041 State() {} 00042 State( StateType s ) 00043 { 00044 stateType = s; 00045 reason = ""; 00046 } 00047 State( StateType s, const std::string &r ) 00048 { 00049 stateType = s; 00050 reason = r; 00051 } 00052 00053 StateType stateType; 00054 std::string reason; 00055 }; 00057 00058 gbxiceutilacfr::Store<State> stateStore_; 00059 00060 }; 00061 00062 } 00063 00064 #endif |
Webmaster: Tobias Kaupp (tobasco at users.sourceforge.net)