rad 6.2.0
Loading...
Searching...
No Matches
Public Member Functions | List of all members
scxml4cpp::Action Class Referenceabstract

#include <Action.h>

Inheritance diagram for scxml4cpp::Action:
MyAction MyAction ReplyAction ReplyAction SignalAction TestAction TestAppendAction TestCondition TestCondition TestDOMSCXMLReaderAction TestDummyAction TestExecutableContentAction TestExecutableContentAction2 TestExecutorAction TestHelperAction TestMergerAction TestReplaceAction TestWarningsAction TimerAction TrsHealthAction rad::ActionCallback rad::GuardCallback scxml4cpp::ActionTrace

Public Member Functions

 Action (const std::string &id)
 
virtual ~Action ()
 
std::string getId () const
 
std::string getParam () const
 
void setId (const std::string &id)
 
void setParam (const std::string &p)
 
virtual void execute (Context *c)=0
 
virtual bool evaluate (Context *c)=0
 

Detailed Description

This class represents an interface for an Action.

An action is a piece of code executed by the State Machine interpreter. Since the execution is synchronous, it is blocking the interpretation of the SCXML document.

The implementation of the action can be added by sub-classing and implementing the execute() virtual method.

This class can also be used to implement a guard by sub-classing and implementing the evaluate() virtual method.

Actions can be executed when entering, exiting, or transitioning to a state.

Guards are evaluated before taking a transition.

Constructor & Destructor Documentation

◆ Action()

scxml4cpp::Action::Action ( const std::string & id)

Create a generic action object.

Parameters
idIdentifier of the action.

◆ ~Action()

scxml4cpp::Action::~Action ( )
virtual

Member Function Documentation

◆ evaluate()

virtual bool scxml4cpp::Action::evaluate ( Context * c)
pure virtual

Evaluate a guard condition usually verified before taking a transition. The evaluation is blocking the State Machine interpreter and therefore should be short (ideally it should last 0 time).

Parameters
cContext for the execution of the action.
Returns
true If the guard is satisfied, false otherwise.

Implemented in scxml4cpp::ActionTrace, rad::ActionCallback, MyAction, SignalAction, TestDummyAction, ReplyAction, ReplyAction, TimerAction, TrsHealthAction, MyAction, TestExecutableContentAction, TestExecutableContentAction2, TestExecutorAction, TestHelperAction, TestMergerAction, TestCondition, TestAction, TestCondition, TestAppendAction, TestDOMSCXMLReaderAction, TestReplaceAction, TestWarningsAction, and rad::GuardCallback.

◆ execute()

virtual void scxml4cpp::Action::execute ( Context * c)
pure virtual

Execute the task associated to the action. The execution is blocking the State Machine interpreter and therefore should be short (ideally it should last 0 time).

Parameters
cContext for the execution of the action.

Implemented in scxml4cpp::ActionTrace, rad::ActionCallback, MyAction, SignalAction, TestDummyAction, ReplyAction, ReplyAction, TimerAction, TrsHealthAction, MyAction, TestExecutableContentAction, TestExecutableContentAction2, TestExecutorAction, TestHelperAction, TestMergerAction, TestCondition, TestAction, TestCondition, TestAppendAction, TestDOMSCXMLReaderAction, TestReplaceAction, TestWarningsAction, and rad::GuardCallback.

◆ getId()

std::string scxml4cpp::Action::getId ( ) const
Returns
The action identifier.

◆ getParam()

std::string scxml4cpp::Action::getParam ( ) const
Returns
The action/guard parameters in string format.

◆ setId()

void scxml4cpp::Action::setId ( const std::string & id)

Set the action identifier.

Parameters
idThe action identifier.

◆ setParam()

void scxml4cpp::Action::setParam ( const std::string & p)

Set the action parameters.

Parameters
pThe action parameters in string format.

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