rad  5.1.0
Public Member Functions | List of all members
scxml4cpp::Transition Class Reference

#include <Transition.h>

Public Member Functions

 Transition ()
 
virtual ~Transition ()
 
StategetSource ()
 
const EventgetEvent ()
 
std::list< State * > & getTargets ()
 
void addTarget (State *s)
 
void addAction (Action *a)
 
void addCondition (Action *c)
 
ExecutableContentgetActions ()
 
ExecutableContentgetConditions ()
 
bool isEnabled (Context *c)
 
bool isEnabled (const Event &e, Context *c)
 
void setSource (State *source)
 
void setTargets (std::list< State * > &targets)
 
void setEvent (const Event &e)
 

Detailed Description

This class represents a State Machine transition.

It can be used for:

Constructor & Destructor Documentation

◆ Transition()

Transition::Transition ( )

Creates a transition object.

It allocates two ExecutableContent objects:

  • for the actions
  • for the guards

◆ ~Transition()

Transition::~Transition ( )
virtual

Deletes a transition object.

It deallocates the two ExecutableContent objects:

  • for the actions
  • for the guards

Member Function Documentation

◆ addAction()

void Transition::addAction ( Action a)

Add an action to the ExecutableContent to be executed when the transition is taken.

Parameters
aPointer to an action.

◆ addCondition()

void Transition::addCondition ( Action c)

Add a guard to the ExecutableContent to be evaluated before a transition is taken.

Parameters
aPointer to an action which represent a guard.

◆ addTarget()

void Transition::addTarget ( State s)

Add a target state to the transition.

Parameters
sPointer to a target state to be added.

◆ getActions()

ExecutableContent * Transition::getActions ( )
Returns
A pointer to ExecutableContent containing the list of actions associated to the transition.

◆ getConditions()

ExecutableContent * Transition::getConditions ( )
Returns
A pointer to ExecutableContent containing the list of guards associated to the transition.

◆ getEvent()

const Event & Transition::getEvent ( )
Returns
A reference to the transition triggering event.

◆ getSource()

State * Transition::getSource ( )
Returns
A pointer to the transition source state.

◆ getTargets()

std::list< State * > & Transition::getTargets ( )
Returns
A reference to a list of possible target states.

◆ isEnabled() [1/2]

bool Transition::isEnabled ( const Event e,
Context c 
)
Returns
true if the given event matches the event in the transition and the guard is satisfied.

◆ isEnabled() [2/2]

bool Transition::isEnabled ( Context c)
Returns
true if the transition has NULL event and the guard is satisfied.

◆ setEvent()

void Transition::setEvent ( const Event e)

Set the event that should trigger the transition.

◆ setSource()

void Transition::setSource ( State source)

Set the source state of the transition.

Parameters
sPointer to a source state.

◆ setTargets()

void Transition::setTargets ( std::list< State * > &  targets)

Set the target state(s) of the transition.

Parameters
targetsList of target states.

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