summaryrefslogtreecommitdiffstats
path: root/src/uscxml/plugins
diff options
context:
space:
mode:
authorStefan Radomski <github@mintwerk.de>2016-12-12 12:58:40 (GMT)
committerStefan Radomski <github@mintwerk.de>2016-12-12 12:58:40 (GMT)
commit7b55e48d57c061bd65e7718a41bfddd90084345e (patch)
treea371c34147528f5ed0a3a8e53bf6c2d52149dcc0 /src/uscxml/plugins
parent277ca19814890939d5d0e4551e3acb651b1c42e6 (diff)
downloaduscxml-7b55e48d57c061bd65e7718a41bfddd90084345e.zip
uscxml-7b55e48d57c061bd65e7718a41bfddd90084345e.tar.gz
uscxml-7b55e48d57c061bd65e7718a41bfddd90084345e.tar.bz2
Added test / example for pausable eventqueue
Diffstat (limited to 'src/uscxml/plugins')
-rw-r--r--src/uscxml/plugins/DataModelImpl.h4
-rw-r--r--src/uscxml/plugins/ExecutableContentImpl.h4
-rw-r--r--src/uscxml/plugins/Invoker.h6
-rw-r--r--src/uscxml/plugins/datamodel/lua/LuaDataModel.cpp28
-rw-r--r--src/uscxml/plugins/invoker/scxml/USCXMLInvoker.cpp43
5 files changed, 42 insertions, 43 deletions
diff --git a/src/uscxml/plugins/DataModelImpl.h b/src/uscxml/plugins/DataModelImpl.h
index 444a9d4..9ee1ed1 100644
--- a/src/uscxml/plugins/DataModelImpl.h
+++ b/src/uscxml/plugins/DataModelImpl.h
@@ -25,8 +25,8 @@
#include "uscxml/plugins/IOProcessor.h"
namespace XERCESC_NS {
- class DOMDocument;
- class DOMNode;
+class DOMDocument;
+class DOMNode;
}
#include <list>
diff --git a/src/uscxml/plugins/ExecutableContentImpl.h b/src/uscxml/plugins/ExecutableContentImpl.h
index 5424717..3f987bb 100644
--- a/src/uscxml/plugins/ExecutableContentImpl.h
+++ b/src/uscxml/plugins/ExecutableContentImpl.h
@@ -27,8 +27,8 @@
#include <sstream>
namespace XERCESC_NS {
- class DOMDocument;
- class DOMNode;
+class DOMDocument;
+class DOMNode;
}
namespace uscxml {
diff --git a/src/uscxml/plugins/Invoker.h b/src/uscxml/plugins/Invoker.h
index 54458f0..2191e7b 100644
--- a/src/uscxml/plugins/Invoker.h
+++ b/src/uscxml/plugins/Invoker.h
@@ -26,9 +26,9 @@
#include "uscxml/messages/Event.h"
namespace XERCESC_NS {
- class DOMElement;
- class DOMDocument;
- class DOMNode;
+class DOMElement;
+class DOMDocument;
+class DOMNode;
}
namespace uscxml {
diff --git a/src/uscxml/plugins/datamodel/lua/LuaDataModel.cpp b/src/uscxml/plugins/datamodel/lua/LuaDataModel.cpp
index 59c2427..55c4501 100644
--- a/src/uscxml/plugins/datamodel/lua/LuaDataModel.cpp
+++ b/src/uscxml/plugins/datamodel/lua/LuaDataModel.cpp
@@ -326,7 +326,7 @@ void LuaDataModel::setEvent(const Event& event) {
Data LuaDataModel::evalAsData(const std::string& content) {
Data data;
- ErrorEvent originalError;
+ ErrorEvent originalError;
std::string trimmedExpr = boost::trim_copy(content);
@@ -338,31 +338,31 @@ Data LuaDataModel::evalAsData(const std::string& content) {
lua_pop(_luaState, retVals);
return data;
} catch (ErrorEvent e) {
- originalError = e;
+ originalError = e;
}
- int retVals = 0;
+ int retVals = 0;
try {
// evaluate again without the return()
retVals = luaEval(_luaState, trimmedExpr);
- } catch (ErrorEvent e) {
- throw originalError; // we will assume syntax error and throw
- }
+ } catch (ErrorEvent e) {
+ throw originalError; // we will assume syntax error and throw
+ }
- if (retVals == 0)
- throw originalError; // we will assume syntax error and throw
+ if (retVals == 0)
+ throw originalError; // we will assume syntax error and throw
-
- try {
+
+ try {
if (retVals == 1) {
data = getLuaAsData(_luaState, luabridge::LuaRef::fromStack(_luaState, -1));
}
lua_pop(_luaState, retVals);
return data;
-
- } catch (ErrorEvent e) {
- throw e; // we will assume syntax error and throw
- }
+
+ } catch (ErrorEvent e) {
+ throw e; // we will assume syntax error and throw
+ }
return data;
diff --git a/src/uscxml/plugins/invoker/scxml/USCXMLInvoker.cpp b/src/uscxml/plugins/invoker/scxml/USCXMLInvoker.cpp
index 26fc024..868fee7 100644
--- a/src/uscxml/plugins/invoker/scxml/USCXMLInvoker.cpp
+++ b/src/uscxml/plugins/invoker/scxml/USCXMLInvoker.cpp
@@ -100,7 +100,7 @@ void USCXMLInvoker::run(void* instance) {
InterpreterState state = USCXML_UNDEF;
while(state != USCXML_FINISHED) {
- state = INSTANCE->_invokedInterpreter.step(true);
+ state = INSTANCE->_invokedInterpreter.step();
// if (!INSTANCE->_isStarted) {
// // we have been cancelled
@@ -158,31 +158,30 @@ void USCXMLInvoker::invoke(const std::string& source, const Event& invokeEvent)
_invokedInterpreter.getImpl()->_invokeId = invokeEvent.invokeid;
_invokedInterpreter.getImpl()->_invokeReq = invokeEvent;
- // create new instances from the parent's ActionLanguage
+ // create new instances from the parent's ActionLanguage
#if 1
- InterpreterImpl* invoked = _invokedInterpreter.getImpl().get();
- invoked->_execContent = _interpreter->_execContent.getImpl()->create(invoked);
- invoked->_delayQueue = _interpreter->_delayQueue.getImplDelayed()->create(invoked);
- invoked->_internalQueue = _interpreter->_internalQueue.getImplBase()->create();
- invoked->_externalQueue = _interpreter->_externalQueue.getImplBase()->create();
- invoked->_microStepper = _interpreter->_microStepper.getImpl()->create(invoked);
-
- // TODO: setup invokers dom, check datamodel attribute and create new instance from parent if matching?
+ InterpreterImpl* invoked = _invokedInterpreter.getImpl().get();
+ invoked->_execContent = _interpreter->_execContent.getImpl()->create(invoked);
+ invoked->_delayQueue = _interpreter->_delayQueue.getImplDelayed()->create(invoked);
+ invoked->_internalQueue = _interpreter->_internalQueue.getImplBase()->create();
+ invoked->_externalQueue = _interpreter->_externalQueue.getImplBase()->create();
+ invoked->_microStepper = _interpreter->_microStepper.getImpl()->create(invoked);
+
+ // TODO: setup invokers dom, check datamodel attribute and create new instance from parent if matching?
#endif
// copy monitors
-// std::set<InterpreterMonitor*>::const_iterator monIter = _interpreter->_monitors.begin();
-// while(monIter != _interpreter->_monitors.end()) {
-// if ((*monIter)->copyToInvokers()) {
-// _invokedInterpreter.getImpl()->_monitors.insert(*monIter);
-// }
-// monIter++;
-// }
-
+ std::set<InterpreterMonitor*>::const_iterator monIter = _interpreter->_monitors.begin();
+ while(monIter != _interpreter->_monitors.end()) {
+ if ((*monIter)->copyToInvokers()) {
+ _invokedInterpreter.getImpl()->_monitors.insert(*monIter);
+ }
+ monIter++;
+ }
- /**
- * test240 assumes that invoke request params will carry over to the datamodel
- * This is solved by passing the invoke request above
- */
+ /**
+ * test240 assumes that invoke request params will carry over to the datamodel
+ * This is solved by passing the invoke request above
+ */
// _invokedInterpreter.getImpl()->setInvokeRequest(req);
_isActive = true;