FACT++
1.0
|
A struct which stores an index, a comment and a name of a State. More...
#include <State.h>
Public Types | |
enum | States { kOffline = 1, kDisconnected, kConnecting, kConnected, kConfiguring1, kConfiguring2, kConfiguring3, kConfigured, kRunInProgress } |
Public Member Functions | |
State (int i=-256, const std::string &n="", const std::string &c="", const Time &t=Time(Time::none)) | |
Static Public Member Functions | |
static std::vector< State > | SplitStates (const std::string &buffer) |
Time of state change. More... | |
static bool | Compare (const State &i, const State &j) |
Public Attributes | |
int | index |
std::string | name |
Index (e.g. 1) More... | |
std::string | comment |
Name (e.g. 'Connected') More... | |
Time | time |
Description (e.g. 'Connection to hardware established.') More... | |
A struct which stores an index, a comment and a name of a State.
To have proper descriptions of states in the network, this struct provides a simple storage for the properties of a state.
Assume you want to write a descriptive string for a state machine with two states, it could look like this:
"1:Disconnected=Connection not established\n2:Connected=Connection established."
Such a string can then be converted with SplitStates into a vector of State objects.