diff options
Diffstat (limited to 'src/uscxml/plugins')
-rw-r--r-- | src/uscxml/plugins/DataModelImpl.h | 4 | ||||
-rw-r--r-- | src/uscxml/plugins/ExecutableContentImpl.h | 4 | ||||
-rw-r--r-- | src/uscxml/plugins/Invoker.h | 6 | ||||
-rw-r--r-- | src/uscxml/plugins/datamodel/lua/LuaDataModel.cpp | 28 | ||||
-rw-r--r-- | src/uscxml/plugins/invoker/scxml/USCXMLInvoker.cpp | 43 |
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; |