summaryrefslogtreecommitdiffstats
path: root/src/uscxml/Interpreter.h
diff options
context:
space:
mode:
authorStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2014-08-26 08:54:58 (GMT)
committerStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2014-08-26 08:54:58 (GMT)
commitd90b15c96271d2afd45d649e3e22030004359d6e (patch)
treedb773868e71fd51fb05e5160e1138bec8087eac9 /src/uscxml/Interpreter.h
parent93802c6eab1f798ccf57e863127aef6e7f9d073c (diff)
downloaduscxml-d90b15c96271d2afd45d649e3e22030004359d6e.zip
uscxml-d90b15c96271d2afd45d649e3e22030004359d6e.tar.gz
uscxml-d90b15c96271d2afd45d649e3e22030004359d6e.tar.bz2
API changes with receiveEvent
- receiveEvent will deliver to external queue now per default - switched Interpreter implementations to the new algorithm from spec
Diffstat (limited to 'src/uscxml/Interpreter.h')
-rw-r--r--src/uscxml/Interpreter.h23
1 files changed, 17 insertions, 6 deletions
diff --git a/src/uscxml/Interpreter.h b/src/uscxml/Interpreter.h
index b2ea027..1f62255 100644
--- a/src/uscxml/Interpreter.h
+++ b/src/uscxml/Interpreter.h
@@ -232,12 +232,8 @@ public:
void copyTo(boost::shared_ptr<InterpreterImpl> other);
// TODO: We need to move the destructor to the implementations to make these pure virtual
- virtual InterpreterState interpret() {
- return _state; ///< Start interpreter blockingly
- }
- virtual InterpreterState step(int waitForMS = 0) {
- return _state;
- }; ///< Perform a single step
+ virtual InterpreterState interpret();
+ virtual InterpreterState step(int waitForMS = 0);
void start(); ///< Start interpretation in a thread
void stop(); ///< Stop interpreter thread
@@ -416,6 +412,7 @@ public:
Arabica::XPath::NodeSet<std::string> getStates(const std::list<std::string>& stateIds);
Arabica::XPath::NodeSet<std::string> getAllStates();
+ Arabica::XPath::NodeSet<std::string> getDocumentInitialTransitions();
Arabica::XPath::NodeSet<std::string> getInitialStates(Arabica::DOM::Element<std::string> state = Arabica::DOM::Element<std::string>());
static Arabica::XPath::NodeSet<std::string> getChildStates(const Arabica::DOM::Node<std::string>& state);
static Arabica::XPath::NodeSet<std::string> getChildStates(const Arabica::XPath::NodeSet<std::string>& state);
@@ -458,6 +455,13 @@ protected:
void initializeData(const Arabica::DOM::Element<std::string>& data);
void finalizeAndAutoForwardCurrentEvent();
+ void stabilize();
+ void microstep(const Arabica::XPath::NodeSet<std::string>& enabledTransitions);
+ void exitInterpreter();
+
+ virtual Arabica::XPath::NodeSet<std::string> selectEventlessTransitions();
+ virtual Arabica::XPath::NodeSet<std::string> selectTransitions(const std::string& event);
+ virtual bool isEnabledTransition(const Arabica::DOM::Element<std::string>& transition, const std::string& event);
void setInterpreterState(InterpreterState newState);
@@ -467,6 +471,13 @@ protected:
tthread::condition_variable _condVar;
tthread::recursive_mutex _pluginMutex;
+ // to be overwritten by implementations - these ought to be pure, but impl destructor runs first
+ virtual void enterStates(const Arabica::XPath::NodeSet<std::string>& enabledTransitions) {}
+ virtual void exitStates(const Arabica::XPath::NodeSet<std::string>& enabledTransitions) {}
+ virtual Arabica::XPath::NodeSet<std::string> removeConflictingTransitions(const Arabica::XPath::NodeSet<std::string>& enabledTransitions) {
+ return enabledTransitions;
+ }
+
InterpreterState _state;
URL _baseURI;
URL _sourceURI;