diff options
author | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2012-12-15 19:10:50 (GMT) |
---|---|---|
committer | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2012-12-15 19:10:50 (GMT) |
commit | f1700edcd08d6215888e226618555ba43b5324ec (patch) | |
tree | 738f30de64f699c3f56d2e15963537c9493a24b4 /src/uscxml/plugins/invoker/scxml/USCXMLInvoker.cpp | |
parent | 2855a9ff7b423140237c9e988252fde0cbacd0a1 (diff) | |
download | uscxml-f1700edcd08d6215888e226618555ba43b5324ec.zip uscxml-f1700edcd08d6215888e226618555ba43b5324ec.tar.gz uscxml-f1700edcd08d6215888e226618555ba43b5324ec.tar.bz2 |
Refactoring and plugin support
Diffstat (limited to 'src/uscxml/plugins/invoker/scxml/USCXMLInvoker.cpp')
-rw-r--r-- | src/uscxml/plugins/invoker/scxml/USCXMLInvoker.cpp | 62 |
1 files changed, 62 insertions, 0 deletions
diff --git a/src/uscxml/plugins/invoker/scxml/USCXMLInvoker.cpp b/src/uscxml/plugins/invoker/scxml/USCXMLInvoker.cpp new file mode 100644 index 0000000..0e617b9 --- /dev/null +++ b/src/uscxml/plugins/invoker/scxml/USCXMLInvoker.cpp @@ -0,0 +1,62 @@ +#include "uscxml/Common.h" +#include "USCXMLInvoker.h" +#include "uscxml/Interpreter.h" + +#ifdef BUILD_AS_PLUGINS +#include <Pluma/Connector.hpp> +#endif + +namespace uscxml { + +#ifdef BUILD_AS_PLUGINS +PLUMA_CONNECTOR +bool connect(pluma::Host& host){ + host.add( new USCXMLInvokerProvider() ); + return true; +} +#endif + +USCXMLInvoker::USCXMLInvoker() { +} + + +USCXMLInvoker::~USCXMLInvoker() { + delete _invokedInterpreter; +}; + +Invoker* USCXMLInvoker::create(Interpreter* interpreter) { + USCXMLInvoker* invoker = new USCXMLInvoker(); + invoker->_parentInterpreter = interpreter; + return invoker; +} + +Data USCXMLInvoker::getDataModelVariables() { + Data data; + return data; +} + +void USCXMLInvoker::send(SendRequest& req) { + assert(false); +} + +void USCXMLInvoker::cancel(const std::string sendId) { + assert(false); +} + +void USCXMLInvoker::sendToParent(SendRequest& req) { + req.invokeid = _invokeId; + _parentInterpreter->receive(req); +} + +void USCXMLInvoker::invoke(InvokeRequest& req) { + _invokeId = req.invokeid; + _invokedInterpreter = Interpreter::fromURI(req.src); + DataModel* dataModel = _invokedInterpreter->getDataModel(); + if (dataModel != NULL) { + + } + _invokedInterpreter->setInvoker(this); + _invokedInterpreter->start(); +} + +}
\ No newline at end of file |