RTC Toolkit
1.0.0
|
Class that provides methods to manipulate the state machine model. More...
#include <modelManipulator.hpp>
Public Member Functions | |
ModelManipulator (StateMachine &sm) | |
Constructor. More... | |
std::string | GetParentId (std::string const &id) |
Gets the name of the parent state. More... | |
void | AddState (StateType type, std::string const &id, std::string const &parent_id="", std::string const &activity_id="", std::string const &entry_action_id="", std::string const &exit_action_id="") |
Adds a new state. More... | |
void | DelState (std::string const &id) |
Deletes an existing state including all of its children and transitions. More... | |
void | RepState (std::string const &id, std::string const &new_id) |
Replaces a state with another state. More... | |
void | ModStateId (std::string const &state_id, std::string const &new_state_id) |
Renames a state. More... | |
void | ModStateType (std::string const &state_id, StateType new_state_type) |
Modifies type of state. More... | |
void | ModStateParent (std::string const &state_id, std::string const &new_parent_id) |
Re-parents a state. More... | |
void | ModStateDoActivity (std::string const &state_id, std::string const &new_activity_id) |
Modifies the do-activity of a state. More... | |
void | ModStateEntryAction (std::string const &state_id, std::string const &new_entry_action_id) |
Modifies the entry-action of a state. More... | |
void | ModStateExitAction (std::string const &state_id, std::string const &new_exit_action_id) |
Modifies the exit-action of a state. More... | |
void | ExtStateToParallel (std::string const &id) |
Parallel Extension. More... | |
void | AddTrans (std::string const &source_id, std::string const &target_id, std::string const &event_id="", std::string const &guard_id="", std::string const &action_id="") |
Adds a new transition. More... | |
void | DelTrans (std::string const &source_id, std::string const &target_id, std::string const &event_id="", std::string const &guard_id="") |
Deletes an existing transition. More... | |
void | ModTransTarget (std::string const &source_id, std::string const &target_id, std::string const &event_id, std::string const &guard_id, std::string const &new_target_id) |
Modifies the target state of a transition. More... | |
void | ModTransSource (std::string const &source_id, std::string const &target_id, std::string const &event_id, std::string const &guard_id, std::string const &new_source_id) |
Modifies the source state of a transition. More... | |
void | ModTransEvent (std::string const &source_id, std::string const &target_id, std::string const &event_id, std::string const &guard_id, std::string const &new_event_id) |
Modifies the trigger of a transition. More... | |
void | ModTransGuard (std::string const &source_id, std::string const &target_id, std::string const &event_id, std::string const &guard_id, std::string const &new_guard_id) |
Modifies the guard of a transition. More... | |
void | ModTransAction (std::string const &source_id, std::string const &target_id, std::string const &event_id, std::string const &guard_id, std::string const &new_action_id) |
Modifies the action of a transition. More... | |
Class that provides methods to manipulate the state machine model.
|
explicit |
Constructor.
sm | reference to the state machine model. |
various | rtctk::componentFramework::RtctkException exceptions |
void rtctk::componentFramework::ModelManipulator::AddState | ( | StateType | type, |
std::string const & | id, | ||
std::string const & | parent_id = "" , |
||
std::string const & | activity_id = "" , |
||
std::string const & | entry_action_id = "" , |
||
std::string const & | exit_action_id = "" |
||
) |
Adds a new state.
id | name of the state. |
parent_id | name of the parent state |
activity_id | name of the do-activity, if none then empty string |
entry_action_id | name of the entry-action, if none then empty string |
exit_action_id | name of the exit-action, if none then empty string |
various | rtctk::componentFramework::RtctkException exceptions |
void rtctk::componentFramework::ModelManipulator::AddTrans | ( | std::string const & | source_id, |
std::string const & | target_id, | ||
std::string const & | event_id = "" , |
||
std::string const & | guard_id = "" , |
||
std::string const & | action_id = "" |
||
) |
Adds a new transition.
source_id | name of the source state. |
target_id | name of the target state. |
event_id | name of the event, if none, then empty string. |
guard_id | name of the guard, if none, then empty string. |
action_id | name of the action, if none, then empty string. |
various | rtctk::componentFramework::RtctkException exceptions |
void rtctk::componentFramework::ModelManipulator::DelState | ( | std::string const & | id | ) |
Deletes an existing state including all of its children and transitions.
id | name of the state. |
various | rtctk::componentFramework::RtctkException exceptions |
void rtctk::componentFramework::ModelManipulator::DelTrans | ( | std::string const & | source_id, |
std::string const & | target_id, | ||
std::string const & | event_id = "" , |
||
std::string const & | guard_id = "" |
||
) |
Deletes an existing transition.
source_id | name of the source state. |
target_id | name of the target state. |
event_id | name of the event, if none, then empty string. |
guard_id | name of the guard, if none, then empty string. |
various | rtctk::componentFramework::RtctkException exceptions |
void rtctk::componentFramework::ModelManipulator::ExtStateToParallel | ( | std::string const & | id | ) |
Parallel Extension.
Transforms a state into a parallel state with a default region hosting its behaviour. The state is transformed into a parallel state with a main region that hosts all the sub-states and transitions of the state. So things are moved around. This is necessary to be able to add new orthogonal regions to the parallel state later.
id | name of the state. |
various | rtctk::componentFramework::RtctkException exceptions |
string rtctk::componentFramework::ModelManipulator::GetParentId | ( | std::string const & | id | ) |
Gets the name of the parent state.
id | name of the state. |
various | rtctk::componentFramework::RtctkException exceptions |
void rtctk::componentFramework::ModelManipulator::ModStateDoActivity | ( | std::string const & | state_id, |
std::string const & | new_activity_id | ||
) |
Modifies the do-activity of a state.
id | name of the state. |
new_activity_id | name of the do-activity, if none, then empty string. |
various | rtctk::componentFramework::RtctkException exceptions |
void rtctk::componentFramework::ModelManipulator::ModStateEntryAction | ( | std::string const & | state_id, |
std::string const & | new_entry_action_id | ||
) |
Modifies the entry-action of a state.
id | name of the state. |
new_entry_action_id | name of the entry-action, if none, then empty string. |
various | rtctk::componentFramework::RtctkException exceptions |
void rtctk::componentFramework::ModelManipulator::ModStateExitAction | ( | std::string const & | state_id, |
std::string const & | new_exit_action_id | ||
) |
Modifies the exit-action of a state.
id | name of the state. |
new_exit_action_id | name of the exit-action, if none, then empty string. |
various | rtctk::componentFramework::RtctkException exceptions |
void rtctk::componentFramework::ModelManipulator::ModStateId | ( | std::string const & | state_id, |
std::string const & | new_state_id | ||
) |
Renames a state.
id | name of the state. |
new_id | new name of the state. |
various | rtctk::componentFramework::RtctkException exceptions |
void rtctk::componentFramework::ModelManipulator::ModStateParent | ( | std::string const & | state_id, |
std::string const & | new_parent_id | ||
) |
Re-parents a state.
id | name of the state. |
new_parent_id | new name of the new parent state. |
various | rtctk::componentFramework::RtctkException exceptions |
void rtctk::componentFramework::ModelManipulator::ModStateType | ( | std::string const & | state_id, |
StateType | new_state_type | ||
) |
Modifies type of state.
id | name of the state. |
new_state_type | new type of the state. |
various | RtctkException exceptions |
void rtctk::componentFramework::ModelManipulator::ModTransAction | ( | std::string const & | source_id, |
std::string const & | target_id, | ||
std::string const & | event_id, | ||
std::string const & | guard_id, | ||
std::string const & | new_action_id | ||
) |
Modifies the action of a transition.
source_id | name of the source state. |
target_id | name of the target state. |
event_id | name of the event, if none, then empty string. |
guard_id | name of the guard, if none, then empty string. |
new_action_id | name of the new action, if none, then empty string. |
various | rtctk::componentFramework::RtctkException exceptions |
void rtctk::componentFramework::ModelManipulator::ModTransEvent | ( | std::string const & | source_id, |
std::string const & | target_id, | ||
std::string const & | event_id, | ||
std::string const & | guard_id, | ||
std::string const & | new_event_id | ||
) |
Modifies the trigger of a transition.
source_id | name of the source state. |
target_id | name of the target state. |
event_id | name of the event, if none, then empty string. |
guard_id | name of the guard, if none, then empty string. |
new_event_id | name of the new event, if none, then empty string. |
various | rtctk::componentFramework::RtctkException exceptions |
void rtctk::componentFramework::ModelManipulator::ModTransGuard | ( | std::string const & | source_id, |
std::string const & | target_id, | ||
std::string const & | event_id, | ||
std::string const & | guard_id, | ||
std::string const & | new_guard_id | ||
) |
Modifies the guard of a transition.
source_id | name of the source state. |
target_id | name of the target state. |
event_id | name of the event, if none, then empty string. |
guard_id | name of the guard, if none, then empty string. |
new_guard_id | name of the new guard, if none, then empty string. |
various | rtctk::componentFramework::RtctkException exceptions |
void rtctk::componentFramework::ModelManipulator::ModTransSource | ( | std::string const & | source_id, |
std::string const & | target_id, | ||
std::string const & | event_id, | ||
std::string const & | guard_id, | ||
std::string const & | new_source_id | ||
) |
Modifies the source state of a transition.
source_id | name of the source state. |
target_id | name of the target state. |
event_id | name of the event, if none, then empty string. |
guard_id | name of the guard, if none, then empty string. |
new_source_id | name of the new source state. |
various | rtctk::componentFramework::RtctkException exceptions |
void rtctk::componentFramework::ModelManipulator::ModTransTarget | ( | std::string const & | source_id, |
std::string const & | target_id, | ||
std::string const & | event_id, | ||
std::string const & | guard_id, | ||
std::string const & | new_target_id | ||
) |
Modifies the target state of a transition.
source_id | name of the source state. |
target_id | name of the target state. |
event_id | name of the event, if none, then empty string. |
guard_id | name of the guard, if none, then empty string. |
new_target_id | name of the new target state. |
various | rtctk::componentFramework::RtctkException exceptions |
void rtctk::componentFramework::ModelManipulator::RepState | ( | std::string const & | id, |
std::string const & | new_id | ||
) |
Replaces a state with another state.
The new state will receive all the transitions and the other state will be deleted
id | name of the state to be replaced |
new_id | name of the state to replace it with |
various | rtctk::componentFramework::RtctkException exceptions |