|
MIRA
|
SCXML based state machine interpreter. More...
#include <sm/StateMachine.h>
Classes | |
| struct | EventLessComp |
Public Types | |
| typedef iterable_priority_queue< Event, std::vector< Event >, EventLessComp > | EventQueue |
Public Member Functions | |
| StateMachine (Authority *authority=NULL, const std::string &name="") | |
| ~StateMachine () | |
| template<typename Reflector > | |
| void | reflect (Reflector &r) |
| void | load (const Path &filename) |
| Load a state machine configuration from a scxml file. More... | |
| void | run () |
| Starts the interpreter. More... | |
| void | interrupt () |
| Interrupt the interpreter. More... | |
| void | sendEvent (const Event &event) |
| Send an event to the state machine. More... | |
| void | sendEventByName (const std::string &event) |
| Send an event by name to the state machine. More... | |
| void | sendEventByName (const std::string &event, const std::string &jsonData) |
| void | sendEventByName (const std::string &event, const std::string &jsonData, const uint64 delay) |
| void | cancelEvent (const std::string &sendid) |
| Cancels an delayed event. More... | |
| bool | inState (const std::string &state) const |
| Checks if the state machines current configuration contains the given state (meaning the given state is active) More... | |
| bool | isRunning () const |
| Returns if the interpreter is running. More... | |
| void | printStates () |
| Prints the states and transitions to console. More... | |
| std::set< std::string > | getConfiguration () const |
| void | addListener (StateMachineListener *listener) |
| Add a listener that gets notified on each state exit, state entry and whenever a transition is executed. More... | |
| std::string | getNamespace () const |
| Gets namespace from authority. More... | |
| std::string | resolveName (const std::string &name) const |
| Call resolveName on the authority that is coupled with the state machine. More... | |
| std::string | resolveServiceName (const std::string &name) const |
| Call resolveServiceName on the authority that is coupled with the state machine. More... | |
Public Attributes | |
| std::string | mName |
| XMLDom | mDocument |
| uint32 | mCurrentID |
| TransitionTargetPtr | mSCXML |
| std::string | mBinding |
| std::map< std::string, TransitionTargetPtr > | mTargets |
| std::map< std::string, TransitionTargetSet > | mHistoryValue |
| boost::mutex | mRunMutex |
| bool | mRunning |
| TransitionTargetSet | mConfiguration |
| EventQueue | mInternalEvents |
| EventQueue | mExternalEvents |
| std::set< std::string > | mSubscribedChannels |
| Channel< std::set< std::string > > | mStateChannel |
| Channel< std::set< std::string > > | mCompressedStateChannel |
| Event | mCurrentEvent |
| std::vector< StateMachineListener * > | mListener |
| boost::python::object | mPythonContext |
| Authority * | mParentAuthority |
| boost::shared_ptr< Authority > | mAuthority |
SCXML based state machine interpreter.
| typedef iterable_priority_queue<Event, std::vector<Event>, EventLessComp> EventQueue |
| StateMachine | ( | Authority * | authority = NULL, |
| const std::string & | name = "" |
||
| ) |
| ~StateMachine | ( | ) |
|
inline |
| void load | ( | const Path & | filename | ) |
Load a state machine configuration from a scxml file.
| void run | ( | ) |
Starts the interpreter.
This method blocks until the state machine reaches a final configuration.
|
inline |
Interrupt the interpreter.
| void sendEvent | ( | const Event & | event | ) |
Send an event to the state machine.
|
inline |
Send an event by name to the state machine.
|
inline |
| void sendEventByName | ( | const std::string & | event, |
| const std::string & | jsonData, | ||
| const uint64 | delay | ||
| ) |
| void cancelEvent | ( | const std::string & | sendid | ) |
Cancels an delayed event.
The event will be marked as 'canceled' and not processed later.
| bool inState | ( | const std::string & | state | ) | const |
Checks if the state machines current configuration contains the given state (meaning the given state is active)
|
inline |
Returns if the interpreter is running.
| void printStates | ( | ) |
Prints the states and transitions to console.
| std::set<std::string> getConfiguration | ( | ) | const |
| void addListener | ( | StateMachineListener * | listener | ) |
Add a listener that gets notified on each state exit, state entry and whenever a transition is executed.
| std::string getNamespace | ( | ) | const |
Gets namespace from authority.
Returns "/" if no authority exists.
| std::string resolveName | ( | const std::string & | name | ) | const |
Call resolveName on the authority that is coupled with the state machine.
Returns the given name if no authority exists.
| std::string resolveServiceName | ( | const std::string & | name | ) | const |
Call resolveServiceName on the authority that is coupled with the state machine.
Returns the given name if no authority exists.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
| std::string mName |
| XMLDom mDocument |
| uint32 mCurrentID |
| TransitionTargetPtr mSCXML |
| std::string mBinding |
| std::map<std::string, TransitionTargetPtr> mTargets |
| std::map<std::string, TransitionTargetSet> mHistoryValue |
|
mutable |
| bool mRunning |
| TransitionTargetSet mConfiguration |
| EventQueue mInternalEvents |
| EventQueue mExternalEvents |
| std::set<std::string> mSubscribedChannels |
| Channel<std::set<std::string> > mStateChannel |
| Channel<std::set<std::string> > mCompressedStateChannel |
| Event mCurrentEvent |
| std::vector<StateMachineListener*> mListener |
| boost::python::object mPythonContext |
| Authority* mParentAuthority |
| boost::shared_ptr<Authority> mAuthority |
1.8.14