#include <Executor.h>
This class implements an SCXML interpreter.
The execution algorithm is based on a subset of the W3C SCXML specifications: https://www.w3.org/TR/scxml/
◆ EventHandlingPolicy
enum scxml4cpp::Executor::EventHandlingPolicy |
Event handling policies.
Enumerator |
---|
SILENT | |
REJECT | Event is silently rejected if transition is not enabled.
|
DEFFERRED | Event is rejected with notification, if transition is not enabled.
Not supported,
|
◆ Executor()
Constructor.
- Parameters
-
stateMachine | SCXML document to be executed. |
context | Data context that be needed by the actions and do-activities to be executed. |
events | Shared queue used to inject events to be processed by the interpreter. |
State machine executor.
This class is based on the algorithm presented in Appendix B of the "State Chart (SCXML): State Machine Notation for Control Abstraction", W3C working draft, 2009-10-29.
◆ ~Executor()
scxml4cpp::Executor::~Executor |
( |
| ) |
|
◆ addEventListener()
void scxml4cpp::Executor::addEventListener |
( |
EventListener * | eventListener | ) |
|
Add a listener to the event notifications.
- Parameters
-
eventListener | Listener to be added. |
◆ addStatusListener()
void scxml4cpp::Executor::addStatusListener |
( |
StatusListener * | statusListener | ) |
|
Add a listener to the status notifications.
- Parameters
-
statusListener | Listener to be added. |
◆ formatModel()
std::string scxml4cpp::Executor::formatModel |
( |
| ) |
|
- Returns
- The in-memory loaded SCXML model to be executed.
◆ formatStatus()
std::string scxml4cpp::Executor::formatStatus |
( |
const bool | usefullyqualified = false | ) |
|
- Returns
- The identifiers of current active states.
- Parameters
-
usefullyqualified | if true the atomic state identifier contains already all the information related to the parent states. If false the atomic state identifier is build concatenating the parents state identifiers. |
◆ getEventHandlingPolicy()
Executor::EventHandlingPolicy scxml4cpp::Executor::getEventHandlingPolicy |
( |
| ) |
|
- Returns
- The currently configured event handling policy.
◆ getStatus()
std::list< State * > scxml4cpp::Executor::getStatus |
( |
| ) |
|
- Returns
- The current active states.
◆ isFinal()
bool scxml4cpp::Executor::isFinal |
( |
| ) |
|
- Returns
- true if the interpreter has reached a final state.
◆ isRunning()
bool scxml4cpp::Executor::isRunning |
( |
| ) |
|
- Returns
- true if the interpreter has not been terminated.
◆ postEvent()
void scxml4cpp::Executor::postEvent |
( |
Event * | e | ) |
|
Adds an event to be processed to the event queue. The method returns immediately. The added process is processed only if the interpreter is started as secondary thread (see run() method).
- Parameters
-
◆ printStatus()
void scxml4cpp::Executor::printStatus |
( |
const bool | usefullyqualified = false | ) |
|
Prints via the logger the result of formatStatus().
- Parameters
-
usefullyqualified | See formatStatus. |
◆ processEvent() [1/2]
void scxml4cpp::Executor::processEvent |
( |
| ) |
|
Process to completion the next event in the event queue. The method returns when the next event in the queue has been fully processed.
◆ processEvent() [2/2]
void scxml4cpp::Executor::processEvent |
( |
Event * | e | ) |
|
Add an event in the event queue and then the processEvent() method is invoked.
- Parameters
-
◆ removeAllEventListener()
void scxml4cpp::Executor::removeAllEventListener |
( |
| ) |
|
Remove all event notification listeners.
◆ removeAllStatusListener()
void scxml4cpp::Executor::removeAllStatusListener |
( |
| ) |
|
Remove all status notification listeners.
◆ removeEventListener()
void scxml4cpp::Executor::removeEventListener |
( |
EventListener * | eventListener | ) |
|
Remove a listener from the event notifications.
- Parameters
-
eventListener | Listener to be removed. |
◆ removeStatusListener()
void scxml4cpp::Executor::removeStatusListener |
( |
StatusListener * | statusListener | ) |
|
Remove a listener from the status notifications.
- Parameters
-
statusListener | Listener to be removed. |
◆ run()
void scxml4cpp::Executor::run |
( |
| ) |
|
This method can be used when starting the SCXML execution on a secondary thread.
◆ setContext()
void scxml4cpp::Executor::setContext |
( |
Context * | context | ) |
|
Set the context to be passed to the Action and Do-Activities.
- Parameters
-
◆ setEventHandlingPolicy()
Configure the event handling policy.
- Parameters
-
policy | Specifies how to processed events. |
◆ start()
void scxml4cpp::Executor::start |
( |
| ) |
|
Start the SCXML execution.
◆ startSM()
void scxml4cpp::Executor::startSM |
( |
| ) |
|
Start the execution of the SCXML document. TODO to be made private?
◆ stop()
void scxml4cpp::Executor::stop |
( |
| ) |
|
Stop the SCXML execution.
◆ stopSM()
void scxml4cpp::Executor::stopSM |
( |
| ) |
|
Stop the execution of the SCXML document. TODO to be made private?
The documentation for this class was generated from the following files: