State Machine Class using Boost::Graph. More...
#include <state_machine.h>
Public Member Functions | |
void | drawStateMachine (std::string dot_filename) |
Function saving state machine in .dot format. More... | |
std::string | getCurrentState () |
Function getting current state name. More... | |
std::string | getDotString () |
Function getting dot string which describe state machine in std::string format. More... | |
std::string | getName () |
get name of the state machine More... | |
std::vector< std::string > | getPossibeTransitions () |
Function for getting possible transition trigger event. More... | |
std::vector< std::string > | getPossibeTransitionStates () |
Function for getting possible transition states. More... | |
StateInfo | getStateInfo () |
Function getting current state info. More... | |
bool | setCurrentState (std::string current_state) |
Function for setting Current State Infomation. More... | |
StateMachine (std::string xml_string) | |
Construct a new State Machine:: State Machine object. More... | |
bool | tryTransition (std::string trigger_event_name) |
Try transition from trigger event. More... | |
~StateMachine () | |
Destroy the State Machine:: State Machine object. More... | |
Private Member Functions | |
void | addTransition (std::string from_state_name, std::string to_state_name, std::string trigger_event_name) |
add Transition function for the State Machine More... | |
template<typename Map > | |
EdgeWriter< Map > | edge_writer_ (Map &map) |
template<typename Map > | |
NodeWriter< Map > | node_writer_ (Map &map, std::string current_state) |
Private Attributes | |
vertex_t | current_state_ |
GraphWriter | graph_writer_ |
std::mutex | mtx_ |
std::string | name_ |
graph_t | state_graph_ |
State Machine Class using Boost::Graph.
Definition at line 104 of file state_machine.h.
StateMachine::StateMachine | ( | std::string | xml_string | ) |
Construct a new State Machine:: State Machine object.
xml_string | XML string for the RostateMachine Definition |
Definition at line 21 of file state_machine.cpp.
StateMachine::~StateMachine | ( | ) |
Destroy the State Machine:: State Machine object.
Definition at line 57 of file state_machine.cpp.
|
private |
add Transition function for the State Machine
from_state_name | state transition from |
to_state_name | state transition to |
trigger_event_name | trigger event |
Definition at line 101 of file state_machine.cpp.
void StateMachine::drawStateMachine | ( | std::string | dot_filename | ) |
Function saving state machine in .dot format.
dot_filename | filename of the .dot file (saved in rostate_machine/data/<dot_filename>.dot) |
Definition at line 297 of file state_machine.cpp.
|
inlineprivate |
Definition at line 127 of file state_machine.h.
std::string StateMachine::getCurrentState | ( | ) |
Function getting current state name.
Definition at line 273 of file state_machine.cpp.
std::string StateMachine::getDotString | ( | ) |
Function getting dot string which describe state machine in std::string format.
Definition at line 283 of file state_machine.cpp.
std::string StateMachine::getName | ( | ) |
get name of the state machine
Definition at line 66 of file state_machine.cpp.
std::vector< std::string > StateMachine::getPossibeTransitions | ( | ) |
Function for getting possible transition trigger event.
Definition at line 196 of file state_machine.cpp.
std::vector< std::string > StateMachine::getPossibeTransitionStates | ( | ) |
Function for getting possible transition states.
Definition at line 178 of file state_machine.cpp.
StateInfo StateMachine::getStateInfo | ( | ) |
Function getting current state info.
Definition at line 246 of file state_machine.cpp.
|
inlineprivate |
Definition at line 125 of file state_machine.h.
bool StateMachine::setCurrentState | ( | std::string | current_state | ) |
Function for setting Current State Infomation.
current_state | target state |
Definition at line 78 of file state_machine.cpp.
bool StateMachine::tryTransition | ( | std::string | trigger_event_name | ) |
Try transition from trigger event.
trigger_event_name | trigger event name |
Definition at line 216 of file state_machine.cpp.
|
private |
Definition at line 122 of file state_machine.h.
|
private |
Definition at line 128 of file state_machine.h.
|
private |
Definition at line 120 of file state_machine.h.
|
private |
Definition at line 123 of file state_machine.h.
|
private |
Definition at line 121 of file state_machine.h.