RTC Toolkit  1.0.0
Public Member Functions | List of all members
rtctk::componentFramework::ModelManipulator Class Reference

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...
 

Detailed Description

Class that provides methods to manipulate the state machine model.

Constructor & Destructor Documentation

◆ ModelManipulator()

rtctk::componentFramework::ModelManipulator::ModelManipulator ( StateMachine sm)
explicit

Constructor.

Parameters
smreference to the state machine model.
Exceptions
variousrtctk::componentFramework::RtctkException exceptions

Member Function Documentation

◆ AddState()

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.

Parameters
idname of the state.
parent_idname of the parent state
activity_idname of the do-activity, if none then empty string
entry_action_idname of the entry-action, if none then empty string
exit_action_idname of the exit-action, if none then empty string
Exceptions
variousrtctk::componentFramework::RtctkException exceptions

◆ AddTrans()

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.

Parameters
source_idname of the source state.
target_idname of the target state.
event_idname of the event, if none, then empty string.
guard_idname of the guard, if none, then empty string.
action_idname of the action, if none, then empty string.
Exceptions
variousrtctk::componentFramework::RtctkException exceptions

◆ DelState()

void rtctk::componentFramework::ModelManipulator::DelState ( std::string const &  id)

Deletes an existing state including all of its children and transitions.

Parameters
idname of the state.
Exceptions
variousrtctk::componentFramework::RtctkException exceptions

◆ DelTrans()

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.

Parameters
source_idname of the source state.
target_idname of the target state.
event_idname of the event, if none, then empty string.
guard_idname of the guard, if none, then empty string.
Exceptions
variousrtctk::componentFramework::RtctkException exceptions

◆ ExtStateToParallel()

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.

Parameters
idname of the state.
Exceptions
variousrtctk::componentFramework::RtctkException exceptions

◆ GetParentId()

string rtctk::componentFramework::ModelManipulator::GetParentId ( std::string const &  id)

Gets the name of the parent state.

Parameters
idname of the state.
Returns
parent_id name of the parent state
Exceptions
variousrtctk::componentFramework::RtctkException exceptions

◆ ModStateDoActivity()

void rtctk::componentFramework::ModelManipulator::ModStateDoActivity ( std::string const &  state_id,
std::string const &  new_activity_id 
)

Modifies the do-activity of a state.

Parameters
idname of the state.
new_activity_idname of the do-activity, if none, then empty string.
Exceptions
variousrtctk::componentFramework::RtctkException exceptions

◆ ModStateEntryAction()

void rtctk::componentFramework::ModelManipulator::ModStateEntryAction ( std::string const &  state_id,
std::string const &  new_entry_action_id 
)

Modifies the entry-action of a state.

Parameters
idname of the state.
new_entry_action_idname of the entry-action, if none, then empty string.
Exceptions
variousrtctk::componentFramework::RtctkException exceptions

◆ ModStateExitAction()

void rtctk::componentFramework::ModelManipulator::ModStateExitAction ( std::string const &  state_id,
std::string const &  new_exit_action_id 
)

Modifies the exit-action of a state.

Parameters
idname of the state.
new_exit_action_idname of the exit-action, if none, then empty string.
Exceptions
variousrtctk::componentFramework::RtctkException exceptions

◆ ModStateId()

void rtctk::componentFramework::ModelManipulator::ModStateId ( std::string const &  state_id,
std::string const &  new_state_id 
)

Renames a state.

Parameters
idname of the state.
new_idnew name of the state.
Exceptions
variousrtctk::componentFramework::RtctkException exceptions

◆ ModStateParent()

void rtctk::componentFramework::ModelManipulator::ModStateParent ( std::string const &  state_id,
std::string const &  new_parent_id 
)

Re-parents a state.

Parameters
idname of the state.
new_parent_idnew name of the new parent state.
Exceptions
variousrtctk::componentFramework::RtctkException exceptions

◆ ModStateType()

void rtctk::componentFramework::ModelManipulator::ModStateType ( std::string const &  state_id,
StateType  new_state_type 
)

Modifies type of state.

Parameters
idname of the state.
new_state_typenew type of the state.
Exceptions
variousRtctkException exceptions

◆ ModTransAction()

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.

Parameters
source_idname of the source state.
target_idname of the target state.
event_idname of the event, if none, then empty string.
guard_idname of the guard, if none, then empty string.
new_action_idname of the new action, if none, then empty string.
Exceptions
variousrtctk::componentFramework::RtctkException exceptions

◆ ModTransEvent()

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.

Parameters
source_idname of the source state.
target_idname of the target state.
event_idname of the event, if none, then empty string.
guard_idname of the guard, if none, then empty string.
new_event_idname of the new event, if none, then empty string.
Exceptions
variousrtctk::componentFramework::RtctkException exceptions

◆ ModTransGuard()

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.

Parameters
source_idname of the source state.
target_idname of the target state.
event_idname of the event, if none, then empty string.
guard_idname of the guard, if none, then empty string.
new_guard_idname of the new guard, if none, then empty string.
Exceptions
variousrtctk::componentFramework::RtctkException exceptions

◆ ModTransSource()

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.

Parameters
source_idname of the source state.
target_idname of the target state.
event_idname of the event, if none, then empty string.
guard_idname of the guard, if none, then empty string.
new_source_idname of the new source state.
Exceptions
variousrtctk::componentFramework::RtctkException exceptions

◆ ModTransTarget()

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.

Parameters
source_idname of the source state.
target_idname of the target state.
event_idname of the event, if none, then empty string.
guard_idname of the guard, if none, then empty string.
new_target_idname of the new target state.
Exceptions
variousrtctk::componentFramework::RtctkException exceptions

◆ RepState()

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

Parameters
idname of the state to be replaced
new_idname of the state to replace it with
Exceptions
variousrtctk::componentFramework::RtctkException exceptions

The documentation for this class was generated from the following files: