RTC Toolkit 5.1.0
Loading...
Searching...
No Matches
Public Member Functions | List of all members
rtctk::componentFramework::ModelManipulator Class Reference

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.
 

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

Parameters
typeThe type of the state.
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 ( 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.

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 ( const std::string & 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 ( const std::string & source_id,
const std::string & target_id,
const std::string & event_id = "",
const std::string & 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 ( const std::string & 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 ( const std::string & 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 ( const std::string & state_id,
const std::string & new_activity_id )

Modifies the do-activity of a state.

Parameters
state_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 ( const std::string & state_id,
const std::string & new_entry_action_id )

Modifies the entry-action of a state.

Parameters
state_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 ( const std::string & state_id,
const std::string & new_exit_action_id )

Modifies the exit-action of a state.

Parameters
state_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 ( const std::string & state_id,
const std::string & new_state_id )

Renames a state.

Parameters
state_idName of the state.
new_state_idNew name of the state.
Exceptions
variousrtctk::componentFramework::RtctkException exceptions.

◆ ModStateParent()

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

Re-parents a state.

Parameters
state_idName of the state.
new_parent_idNew name of the new parent state.
Exceptions
variousrtctk::componentFramework::RtctkException exceptions.

◆ ModStateType()

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

Modifies type of state.

Parameters
state_idName of the state.
new_state_typeNew type of the state.
Exceptions
variousrtctk::componentFramework::RtctkException exceptions.

◆ ModTransAction()

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.

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

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

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

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

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

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: