summaryrefslogtreecommitdiffstats
path: root/src/uscxml/plugins/invoker/scxml
diff options
context:
space:
mode:
authorStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2013-01-21 23:47:54 (GMT)
committerStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2013-01-21 23:47:54 (GMT)
commit3be96d1aa3024c1acc129e587f5d3165c9434e48 (patch)
treefae65a932b899ed9424a5a76b9b98562d979fe40 /src/uscxml/plugins/invoker/scxml
parent3bda299c6d2efce71d76b44dea8e732a073304f3 (diff)
downloaduscxml-3be96d1aa3024c1acc129e587f5d3165c9434e48.zip
uscxml-3be96d1aa3024c1acc129e587f5d3165c9434e48.tar.gz
uscxml-3be96d1aa3024c1acc129e587f5d3165c9434e48.tar.bz2
See detailed commitlog
- Started DirectoryMonitor invoker - Refactored Invoker / IOProcessor interface - Started with JavaScriptCore bindings - Embedding applications can now use setParentQueue to receive events sent to #_parent
Diffstat (limited to 'src/uscxml/plugins/invoker/scxml')
-rw-r--r--src/uscxml/plugins/invoker/scxml/USCXMLInvoker.cpp14
-rw-r--r--src/uscxml/plugins/invoker/scxml/USCXMLInvoker.h12
2 files changed, 14 insertions, 12 deletions
diff --git a/src/uscxml/plugins/invoker/scxml/USCXMLInvoker.cpp b/src/uscxml/plugins/invoker/scxml/USCXMLInvoker.cpp
index bcdf2d4..4f7d61d 100644
--- a/src/uscxml/plugins/invoker/scxml/USCXMLInvoker.cpp
+++ b/src/uscxml/plugins/invoker/scxml/USCXMLInvoker.cpp
@@ -42,23 +42,21 @@ void USCXMLInvoker::cancel(const std::string sendId) {
assert(false);
}
-void USCXMLInvoker::sendToParent(const SendRequest& req) {
- SendRequest parentReq = req;
- parentReq.invokeid = _invokeId;
- _parentInterpreter->receive(parentReq);
-}
-
void USCXMLInvoker::invoke(const InvokeRequest& req) {
- _invokeId = req.invokeid;
_invokedInterpreter = Interpreter::fromURI(req.src);
DataModel dataModel(_invokedInterpreter->getDataModel());
if (dataModel) {
}
if (_invokedInterpreter) {
- _invokedInterpreter->setInvoker(boost::static_pointer_cast<InvokerImpl>(shared_from_this()));
+ _invokedInterpreter->setParentQueue(this);
_invokedInterpreter->start();
}
}
+void USCXMLInvoker::push(Event& event) {
+ event.invokeid = _invokeId;
+ _parentInterpreter->receive(event);
+}
+
} \ No newline at end of file
diff --git a/src/uscxml/plugins/invoker/scxml/USCXMLInvoker.h b/src/uscxml/plugins/invoker/scxml/USCXMLInvoker.h
index 62851e3..792cc5d 100644
--- a/src/uscxml/plugins/invoker/scxml/USCXMLInvoker.h
+++ b/src/uscxml/plugins/invoker/scxml/USCXMLInvoker.h
@@ -2,7 +2,8 @@
#define USCXMLINVOKER_H_OQFA21IO
#include <uscxml/Interpreter.h>
-#include <boost//enable_shared_from_this.hpp>
+#include <boost/enable_shared_from_this.hpp>
+#include "uscxml/concurrency/BlockingQueue.h"
#ifdef BUILD_AS_PLUGINS
#include "uscxml/plugins/Plugins.h"
@@ -12,7 +13,10 @@ namespace uscxml {
class Interpreter;
-class USCXMLInvoker : public InvokerImpl, public boost::enable_shared_from_this<USCXMLInvoker> {
+class USCXMLInvoker :
+ public InvokerImpl,
+ public uscxml::concurrency::BlockingQueue<Event>,
+ public boost::enable_shared_from_this<USCXMLInvoker> {
public:
USCXMLInvoker();
virtual ~USCXMLInvoker();
@@ -29,10 +33,10 @@ public:
virtual void send(const SendRequest& req);
virtual void cancel(const std::string sendId);
virtual void invoke(const InvokeRequest& req);
- virtual void sendToParent(const SendRequest& req);
+
+ virtual void push(Event& event);
protected:
- std::string _invokeId;
Interpreter* _invokedInterpreter;
Interpreter* _parentInterpreter;
};