2 #include <unordered_set> 9 extern src::severity_logger<severity_level>
lg;
154 std::map<int, int> newmap;
StateMachine()
StateMachine constructor.
void setCurrState(int state)
sets current state
void addTransition(int, int, int)
add a single transition i.e. tuple (key_input, curr_state, next_state)
int prev_state
state variable holding previous state value
bool isChanged() const
returns true if prev_state and curr_state are different
int curr_state
state variable holding current state value
int currState() const
returns current state
int prevState() const
returns previous state
std::map< int, std::map< int, int > > state_transitions
state transition table
void delSpace()
deletes one white-space from white-space string corresponding to invoking thread
bool changed
indicates whether state has changed
void addSpace()
adds one white-space to white-space string corresponding to invoking thread
StateMachine(std::map< int, std::map< int, int >> &trans)
StateMachine constructor. Instantiates state machine with provided state transition table.
void reset()
resets state machine into base state as specified in transition table tuple entry (base_state,...
enables indentation of logs for easy viewing
src::severity_logger< severity_level > lg
statemachine that uses integer corresponding to object uuids to represent states
void next()
same as StateMachine::next(int) except that reads key input from global
void stale()
sets changed to false