Scoping struct for application state codes. More...
#include <stateCodes.hpp>
Public Types | |
enum | : stateCodeT { FAILURE =-20 , ERROR =-10 , UNINITIALIZED = 0 , INITIALIZED = 1 , NODEVICE = 2 , POWEROFF = 4 , POWERON = 6 , NOTCONNECTED = 8 , CONNECTED = 10 , LOGGEDIN = 15 , CONFIGURING = 20 , NOTHOMED = 24 , HOMING = 25 , OPERATING = 30 , READY = 35 , SHUTDOWN = 10000 } |
The numeric codes descrbing an application's state. More... | |
typedef int16_t | stateCodeT |
The type of the state code. More... | |
Static Public Member Functions | |
static std::string | codeText (const stateCodeT &stateCode) |
Get an ASCII string corresponding to an application stateCode. More... | |
static stateCodeT | str2Code (const std::string &stateStr) |
Get the stateCode corresponding to an ASCII string. More... | |
static stateCodeT | str2CodeFast (const std::string &stateStr) |
Get the stateCode corresponding to an ASCII string with minimal checks. More... | |
Scoping struct for application state codes.
We do not use the enum class feature since it does not have automatic integer conversion, and it's nice to have static member functions associated.
Definition at line 29 of file stateCodes.hpp.
typedef int16_t MagAOX::app::stateCodes::stateCodeT |
The type of the state code.
Definition at line 35 of file stateCodes.hpp.
|
static |
Get an ASCII string corresponding to an application stateCode.
[in] | stateCode | the stateCode for which the name is desired |
Definition at line 16 of file stateCodes.cpp.
Referenced by MagAOX::app::siglentSDG::appLogic(), MagAOX::logger::state_change::msgString(), and SCENARIO().
|
static |
Get the stateCode corresponding to an ASCII string.
[in] | stateStr | the string represenation of a state code |
Definition at line 59 of file stateCodes.cpp.
Referenced by SCENARIO().
|
static |
Get the stateCode corresponding to an ASCII string with minimal checks.
This matches based on the first character and, if necessary, one more unique character. Other than length checks when necessary, this does minimal validation, so you should only use it if you trust the source of stateStr
. For example, any string that starts with ‘'L’will return stateCodes::LOGGEDIN regardless of the value of
stateStr[1]`.
[in] | stateStr | the string represenation of a state code |
Definition at line 133 of file stateCodes.cpp.
Referenced by SCENARIO().