Class that helps with the creation of FiniteStateMachine.
#include <StateMachineBuilder.hpp>
|
std::vector< State * > | states |
|
std::vector< StateDirector * > | stateDirectors |
|
std::map< int, std::vector< std::pair< int, int > > > | transition_table |
| Stores the transitions of the fsm. More...
|
|
std::string | type |
|
int | initial_state_id |
|
◆ addState()
int rd::StateMachineBuilder::addState |
( |
State * |
state | ) |
|
- Parameters
-
- Returns
- Id Id assigned to the State added
◆ addTransition()
bool rd::StateMachineBuilder::addTransition |
( |
int |
origin_id, |
|
|
int |
destination_id, |
|
|
int |
condition |
|
) |
| |
- Parameters
-
origin_id | Id of the origin state |
destination_id | Id of the destination state |
condition | Condition to trigger this transition |
◆ buildStateMachine()
◆ createStateDirector()
This factory method could be extracted to a factory class to allow new StateDirector without recompiling the StateMachineLib
◆ setDirectorType()
bool rd::StateMachineBuilder::setDirectorType |
( |
const std::string & |
type | ) |
|
◆ transition_table
std::map< int, std::vector<std::pair<int, int> > > rd::StateMachineBuilder::transition_table |
|
private |
The format is the following: { origin_state:[(destination_state, condition)]}
The documentation for this class was generated from the following files: