summaryrefslogtreecommitdiffstats
path: root/src/uscxml/plugins/invoker/scxml
diff options
context:
space:
mode:
authorStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2013-10-16 18:35:17 (GMT)
committerStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2013-10-16 18:35:17 (GMT)
commit60c543c1d8c6699cc96829f15b16ecc60ac0b410 (patch)
treef0087f620d45246acf0268da539cb815796d88c0 /src/uscxml/plugins/invoker/scxml
parent4d186e24e44fe07f04708c2dc38387534c02c7fd (diff)
downloaduscxml-60c543c1d8c6699cc96829f15b16ecc60ac0b410.zip
uscxml-60c543c1d8c6699cc96829f15b16ecc60ac0b410.tar.gz
uscxml-60c543c1d8c6699cc96829f15b16ecc60ac0b410.tar.bz2
Added license information and bug fixes
Diffstat (limited to 'src/uscxml/plugins/invoker/scxml')
-rw-r--r--src/uscxml/plugins/invoker/scxml/USCXMLInvoker.cpp32
-rw-r--r--src/uscxml/plugins/invoker/scxml/USCXMLInvoker.h35
2 files changed, 56 insertions, 11 deletions
diff --git a/src/uscxml/plugins/invoker/scxml/USCXMLInvoker.cpp b/src/uscxml/plugins/invoker/scxml/USCXMLInvoker.cpp
index 85c4b9c..05ea460 100644
--- a/src/uscxml/plugins/invoker/scxml/USCXMLInvoker.cpp
+++ b/src/uscxml/plugins/invoker/scxml/USCXMLInvoker.cpp
@@ -1,3 +1,22 @@
+/**
+ * @file
+ * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de)
+ * @copyright Simplified BSD
+ *
+ * @cond
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the FreeBSD license as published by the FreeBSD
+ * project.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * You should have received a copy of the FreeBSD license along with this
+ * program. If not, see <http://www.opensource.org/licenses/bsd-license>.
+ * @endcond
+ */
+
#include "USCXMLInvoker.h"
#include <glog/logging.h>
@@ -9,13 +28,14 @@ namespace uscxml {
#ifdef BUILD_AS_PLUGINS
PLUMA_CONNECTOR
-bool connect(pluma::Host& host) {
+bool pluginConnect(pluma::Host& host) {
host.add( new USCXMLInvokerProvider() );
return true;
}
#endif
USCXMLInvoker::USCXMLInvoker() : _cancelled(false) {
+ _parentQueue._invoker = this;
}
@@ -62,7 +82,7 @@ void USCXMLInvoker::invoke(const InvokeRequest& req) {
if (dataModel) {
}
- _invokedInterpreter.getImpl()->setParentQueue(this);
+ _invokedInterpreter.getImpl()->setParentQueue(&_parentQueue);
// transfer namespace prefixes
_invokedInterpreter.getImpl()->_nsURL = _parentInterpreter->_nsURL;
_invokedInterpreter.getImpl()->_xpathPrefix = _parentInterpreter->_xpathPrefix;
@@ -86,13 +106,13 @@ void USCXMLInvoker::invoke(const InvokeRequest& req) {
}
}
-void USCXMLInvoker::push(const SendRequest& event) {
+void USCXMLInvoker::ParentQueue::push(const SendRequest& event) {
// test 252
- if (_cancelled)
+ if (_invoker->_cancelled)
return;
SendRequest copyEvent(event);
- copyEvent.invokeid = _invokeId;
- _parentInterpreter->receive(copyEvent);
+ copyEvent.invokeid = _invoker->_invokeId;
+ _invoker->_parentInterpreter->receive(copyEvent);
}
} \ 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 896eaa3..7c0e217 100644
--- a/src/uscxml/plugins/invoker/scxml/USCXMLInvoker.h
+++ b/src/uscxml/plugins/invoker/scxml/USCXMLInvoker.h
@@ -1,3 +1,22 @@
+/**
+ * @file
+ * @author 2012-2013 Stefan Radomski (stefan.radomski@cs.tu-darmstadt.de)
+ * @copyright Simplified BSD
+ *
+ * @cond
+ * This program is free software: you can redistribute it and/or modify
+ * it under the terms of the FreeBSD license as published by the FreeBSD
+ * project.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ *
+ * You should have received a copy of the FreeBSD license along with this
+ * program. If not, see <http://www.opensource.org/licenses/bsd-license>.
+ * @endcond
+ */
+
#ifndef USCXMLINVOKER_H_OQFA21IO
#define USCXMLINVOKER_H_OQFA21IO
@@ -12,12 +31,19 @@
namespace uscxml {
class Interpreter;
-
+class USCXMLInvoker;
+
class USCXMLInvoker :
public InvokerImpl,
- public uscxml::concurrency::BlockingQueue<SendRequest>,
public boost::enable_shared_from_this<USCXMLInvoker> {
public:
+ class ParentQueue : public concurrency::BlockingQueue<SendRequest> {
+ public:
+ ParentQueue() {}
+ virtual void push(const SendRequest& event);
+ USCXMLInvoker* _invoker;
+ };
+
USCXMLInvoker();
virtual ~USCXMLInvoker();
virtual boost::shared_ptr<InvokerImpl> create(InterpreterImpl* interpreter);
@@ -34,11 +60,10 @@ public:
virtual void send(const SendRequest& req);
virtual void cancel(const std::string sendId);
virtual void invoke(const InvokeRequest& req);
-
- virtual void push(const SendRequest& event);
-
+
protected:
bool _cancelled;
+ ParentQueue _parentQueue;
Interpreter _invokedInterpreter;
InterpreterImpl* _parentInterpreter;
};