|
RTC Toolkit 5.1.0
|
Class that provides methods to manipulate the state machine model. More...
#include <rtctk/componentFramework/modelManipulator.hpp>
Public Member Functions | |
| ModelManipulator (StateMachine &sm) | |
| Constructor. | |
| std::string | GetParentId (const std::string &id) |
| Gets the name of the parent state. | |
| void | AddState (StateType type, const std::string &id, const std::string &parent_id="", const std::string &activity_id="", const std::string &entry_action_id="", const std::string &exit_action_id="") |
| Adds a new state. | |
| void | DelState (const std::string &id) |
| Deletes an existing state including all of its children and transitions. | |
| void | RepState (const std::string &id, const std::string &new_id) |
| Replaces a state with another state. | |
| void | ModStateId (const std::string &state_id, const std::string &new_state_id) |
| Renames a state. | |
| void | ModStateType (const std::string &state_id, StateType new_state_type) |
| Modifies type of state. | |
| void | ModStateParent (const std::string &state_id, const std::string &new_parent_id) |
| Re-parents a state. | |
| void | ModStateDoActivity (const std::string &state_id, const std::string &new_activity_id) |
| Modifies the do-activity of a state. | |
| void | ModStateEntryAction (const std::string &state_id, const std::string &new_entry_action_id) |
| Modifies the entry-action of a state. | |
| void | ModStateExitAction (const std::string &state_id, const std::string &new_exit_action_id) |
| Modifies the exit-action of a state. | |
| void | ExtStateToParallel (const std::string &id) |
| Parallel Extension. | |
| void | AddTrans (const std::string &source_id, const std::string &target_id, const std::string &event_id="", const std::string &guard_id="", const std::string &action_id="") |
| Adds a new transition. | |
| void | DelTrans (const std::string &source_id, const std::string &target_id, const std::string &event_id="", const std::string &guard_id="") |
| Deletes an existing transition. | |
| void | ModTransTarget (const std::string &source_id, const std::string &target_id, const std::string &event_id, const std::string &guard_id, const std::string &new_target_id) |
| Modifies the target state of a transition. | |
| void | ModTransSource (const std::string &source_id, const std::string &target_id, const std::string &event_id, const std::string &guard_id, const std::string &new_source_id) |
| Modifies the source state of a transition. | |
| void | ModTransEvent (const std::string &source_id, const std::string &target_id, const std::string &event_id, const std::string &guard_id, const std::string &new_event_id) |
| Modifies the trigger of a transition. | |
| void | ModTransGuard (const std::string &source_id, const std::string &target_id, const std::string &event_id, const std::string &guard_id, const std::string &new_guard_id) |
| Modifies the guard of a transition. | |
| void | ModTransAction (const std::string &source_id, const std::string &target_id, const std::string &event_id, const std::string &guard_id, const std::string &new_action_id) |
| Modifies the action of a transition. | |
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, |
| const std::string & | id, | ||
| const std::string & | parent_id = "", | ||
| const std::string & | activity_id = "", | ||
| const std::string & | entry_action_id = "", | ||
| const std::string & | exit_action_id = "" ) |
Adds a new state.
| type | The type of the 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 | ( | const std::string & | source_id, |
| const std::string & | target_id, | ||
| const std::string & | event_id = "", | ||
| const std::string & | guard_id = "", | ||
| const std::string & | 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. |
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 | ( | const std::string & | source_id, |
| const std::string & | target_id, | ||
| const std::string & | event_id = "", | ||
| const std::string & | 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. |
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 | ( | const std::string & | id | ) |
Gets the name of the parent state.
| id | Name of the state. |
| various | rtctk::componentFramework::RtctkException exceptions. |
| void rtctk::componentFramework::ModelManipulator::ModStateDoActivity | ( | const std::string & | state_id, |
| const std::string & | new_activity_id ) |
Modifies the do-activity of a state.
| 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 | ( | const std::string & | state_id, |
| const std::string & | new_entry_action_id ) |
Modifies the entry-action of a state.
| 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 | ( | const std::string & | state_id, |
| const std::string & | new_exit_action_id ) |
Modifies the exit-action of a state.
| 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 | ( | const std::string & | state_id, |
| const std::string & | new_state_id ) |
Renames a state.
| state_id | Name of the state. |
| new_state_id | New name of the state. |
| various | rtctk::componentFramework::RtctkException exceptions. |
| void rtctk::componentFramework::ModelManipulator::ModStateParent | ( | const std::string & | state_id, |
| const std::string & | new_parent_id ) |
Re-parents a state.
| 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 | ( | const std::string & | state_id, |
| StateType | new_state_type ) |
Modifies type of state.
| state_id | Name of the state. |
| new_state_type | New type of the state. |
| various | rtctk::componentFramework::RtctkException exceptions. |
| void rtctk::componentFramework::ModelManipulator::ModTransAction | ( | const std::string & | source_id, |
| const std::string & | target_id, | ||
| const std::string & | event_id, | ||
| const std::string & | guard_id, | ||
| const std::string & | 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 | ( | const std::string & | source_id, |
| const std::string & | target_id, | ||
| const std::string & | event_id, | ||
| const std::string & | guard_id, | ||
| const std::string & | 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 | ( | const std::string & | source_id, |
| const std::string & | target_id, | ||
| const std::string & | event_id, | ||
| const std::string & | guard_id, | ||
| const std::string & | 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 | ( | const std::string & | source_id, |
| const std::string & | target_id, | ||
| const std::string & | event_id, | ||
| const std::string & | guard_id, | ||
| const std::string & | 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 | ( | const std::string & | source_id, |
| const std::string & | target_id, | ||
| const std::string & | event_id, | ||
| const std::string & | guard_id, | ||
| const std::string & | 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 | ( | const std::string & | id, |
| const std::string & | 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. |