summaryrefslogtreecommitdiffstats
path: root/src/uscxml/plugins
diff options
context:
space:
mode:
authorStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2013-04-06 21:17:13 (GMT)
committerStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2013-04-06 21:17:13 (GMT)
commit1e6ba139ac12c688f025745812d381915775b1fb (patch)
tree1d49070eddd4502ec6aa25a769ab7c47d04a1c30 /src/uscxml/plugins
parent139439f0675ec05e936fd4297086462037cd618e (diff)
downloaduscxml-1e6ba139ac12c688f025745812d381915775b1fb.zip
uscxml-1e6ba139ac12c688f025745812d381915775b1fb.tar.gz
uscxml-1e6ba139ac12c688f025745812d381915775b1fb.tar.bz2
See detailled log
Added new revised W3C tests Hide Interpreter via PIMPL Implemented SCXMLIOProcessor
Diffstat (limited to 'src/uscxml/plugins')
-rw-r--r--src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp10
-rw-r--r--src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.h2
-rw-r--r--src/uscxml/plugins/element/fetch/FetchElement.cpp2
-rw-r--r--src/uscxml/plugins/element/fetch/FetchElement.h2
-rw-r--r--src/uscxml/plugins/element/postpone/PostponeElement.cpp22
-rw-r--r--src/uscxml/plugins/element/postpone/PostponeElement.h14
-rw-r--r--src/uscxml/plugins/element/response/ResponseElement.cpp2
-rw-r--r--src/uscxml/plugins/element/response/ResponseElement.h2
-rw-r--r--src/uscxml/plugins/invoker/ffmpeg/FFMPEGInvoker.cpp2
-rw-r--r--src/uscxml/plugins/invoker/ffmpeg/FFMPEGInvoker.h2
-rw-r--r--src/uscxml/plugins/invoker/filesystem/dirmon/DirMonInvoker.cpp2
-rw-r--r--src/uscxml/plugins/invoker/filesystem/dirmon/DirMonInvoker.h2
-rw-r--r--src/uscxml/plugins/invoker/graphics/openscenegraph/OSGInvoker.cpp2
-rw-r--r--src/uscxml/plugins/invoker/graphics/openscenegraph/OSGInvoker.h2
-rw-r--r--src/uscxml/plugins/invoker/graphics/openscenegraph/converter/OSGConverter.cpp2
-rw-r--r--src/uscxml/plugins/invoker/graphics/openscenegraph/converter/OSGConverter.h2
-rw-r--r--src/uscxml/plugins/invoker/heartbeat/HeartbeatInvoker.cpp2
-rw-r--r--src/uscxml/plugins/invoker/heartbeat/HeartbeatInvoker.h2
-rw-r--r--src/uscxml/plugins/invoker/http/HTTPServletInvoker.cpp2
-rw-r--r--src/uscxml/plugins/invoker/http/HTTPServletInvoker.h2
-rw-r--r--src/uscxml/plugins/invoker/miles/MilesSessionInvoker.cpp2
-rw-r--r--src/uscxml/plugins/invoker/miles/MilesSessionInvoker.h2
-rw-r--r--src/uscxml/plugins/invoker/sample/SampleInvoker.cpp2
-rw-r--r--src/uscxml/plugins/invoker/sample/SampleInvoker.h2
-rw-r--r--src/uscxml/plugins/invoker/scxml/USCXMLInvoker.cpp25
-rw-r--r--src/uscxml/plugins/invoker/scxml/USCXMLInvoker.h6
-rw-r--r--src/uscxml/plugins/invoker/sqlite3/Sqlite3Invoker.cpp2
-rw-r--r--src/uscxml/plugins/invoker/sqlite3/Sqlite3Invoker.h2
-rw-r--r--src/uscxml/plugins/invoker/system/SystemInvoker.cpp2
-rw-r--r--src/uscxml/plugins/invoker/system/SystemInvoker.h2
-rw-r--r--src/uscxml/plugins/invoker/umundo/UmundoInvoker.cpp4
-rw-r--r--src/uscxml/plugins/invoker/umundo/UmundoInvoker.h4
-rw-r--r--src/uscxml/plugins/ioprocessor/basichttp/BasicHTTPIOProcessor.cpp (renamed from src/uscxml/plugins/ioprocessor/basichttp/libevent/EventIOProcessor.cpp)24
-rw-r--r--src/uscxml/plugins/ioprocessor/basichttp/BasicHTTPIOProcessor.h (renamed from src/uscxml/plugins/ioprocessor/basichttp/libevent/EventIOProcessor.h)18
-rw-r--r--src/uscxml/plugins/ioprocessor/dom/DOMIOProcessor.cpp0
-rw-r--r--src/uscxml/plugins/ioprocessor/dom/DOMIOProcessor.h0
-rw-r--r--src/uscxml/plugins/ioprocessor/scxml/SCXMLIOProcessor.cpp141
-rw-r--r--src/uscxml/plugins/ioprocessor/scxml/SCXMLIOProcessor.h36
38 files changed, 264 insertions, 90 deletions
diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp b/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp
index 1d01e12..e653607 100644
--- a/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp
+++ b/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.cpp
@@ -26,7 +26,7 @@ V8DataModel::V8DataModel() {
// _contexts.push_back(v8::Context::New());
}
-boost::shared_ptr<DataModelImpl> V8DataModel::create(Interpreter* interpreter) {
+boost::shared_ptr<DataModelImpl> V8DataModel::create(InterpreterImpl* interpreter) {
boost::shared_ptr<V8DataModel> dm = boost::shared_ptr<V8DataModel>(new V8DataModel());
dm->_interpreter = interpreter;
v8::Locker locker;
@@ -246,17 +246,17 @@ Data V8DataModel::getValueAsData(const v8::Handle<v8::Value>& value) {
v8::Handle<v8::Value> V8DataModel::getDocumentAsValue(const Arabica::DOM::Document<std::string>& doc) {
v8::Handle<v8::Function> retCtor = Arabica::DOM::V8Document::getTmpl()->GetFunction();
v8::Persistent<v8::Object> retObj = v8::Persistent<v8::Object>::New(retCtor->NewInstance());
-
+
struct Arabica::DOM::V8Document::V8DocumentPrivate* retPrivData = new Arabica::DOM::V8Document::V8DocumentPrivate();
retPrivData->dom = _dom;
retPrivData->nativeObj = new Arabica::DOM::Document<std::string>(doc);
-
+
retObj->SetInternalField(0, Arabica::DOM::V8DOM::toExternal(retPrivData));
retObj.MakeWeak(0, Arabica::DOM::V8Document::jsDestructor);
-
+
return retObj;
}
-
+
v8::Handle<v8::Value> V8DataModel::getDataAsValue(const Data& data) {
if (data.compound.size() > 0) {
v8::Handle<v8::Object> value = v8::Object::New();
diff --git a/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.h b/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.h
index e67e4ca..760b638 100644
--- a/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.h
+++ b/src/uscxml/plugins/datamodel/ecmascript/v8/V8DataModel.h
@@ -22,7 +22,7 @@ class V8DataModel : public DataModelImpl {
public:
V8DataModel();
virtual ~V8DataModel();
- virtual boost::shared_ptr<DataModelImpl> create(Interpreter* interpreter);
+ virtual boost::shared_ptr<DataModelImpl> create(InterpreterImpl* interpreter);
virtual std::set<std::string> getNames() {
std::set<std::string> names;
diff --git a/src/uscxml/plugins/element/fetch/FetchElement.cpp b/src/uscxml/plugins/element/fetch/FetchElement.cpp
index eabe0a2..56c1815 100644
--- a/src/uscxml/plugins/element/fetch/FetchElement.cpp
+++ b/src/uscxml/plugins/element/fetch/FetchElement.cpp
@@ -18,7 +18,7 @@ bool connect(pluma::Host& host) {
}
#endif
-boost::shared_ptr<ExecutableContentImpl> FetchElement::create(Interpreter* interpreter) {
+boost::shared_ptr<ExecutableContentImpl> FetchElement::create(InterpreterImpl* interpreter) {
boost::shared_ptr<FetchElement> invoker = boost::shared_ptr<FetchElement>(new FetchElement());
invoker->_interpreter = interpreter;
return invoker;
diff --git a/src/uscxml/plugins/element/fetch/FetchElement.h b/src/uscxml/plugins/element/fetch/FetchElement.h
index b553293..e293afe 100644
--- a/src/uscxml/plugins/element/fetch/FetchElement.h
+++ b/src/uscxml/plugins/element/fetch/FetchElement.h
@@ -13,7 +13,7 @@ class FetchElement : public ExecutableContentImpl, public URLMonitor {
public:
FetchElement() {}
virtual ~FetchElement();
- boost::shared_ptr<ExecutableContentImpl> create(Interpreter* interpreter);
+ boost::shared_ptr<ExecutableContentImpl> create(InterpreterImpl* interpreter);
std::string getLocalName() {
return "fetch";
diff --git a/src/uscxml/plugins/element/postpone/PostponeElement.cpp b/src/uscxml/plugins/element/postpone/PostponeElement.cpp
index baa8e62..54f2499 100644
--- a/src/uscxml/plugins/element/postpone/PostponeElement.cpp
+++ b/src/uscxml/plugins/element/postpone/PostponeElement.cpp
@@ -16,7 +16,7 @@ bool connect(pluma::Host& host) {
}
#endif
-boost::shared_ptr<ExecutableContentImpl> PostponeElement::create(Interpreter* interpreter) {
+boost::shared_ptr<ExecutableContentImpl> PostponeElement::create(InterpreterImpl* interpreter) {
boost::shared_ptr<PostponeElement> invoker = boost::shared_ptr<PostponeElement>(new PostponeElement());
invoker->_interpreter = interpreter;
return invoker;
@@ -97,21 +97,21 @@ void PostponeElement::enterElement(const Arabica::DOM::Node<std::string>& node)
void PostponeElement::exitElement(const Arabica::DOM::Node<std::string>& node) {
}
-void PostponeElement::Resubmitter::postpone(const Event& event, std::string until, uint64_t timeout, bool chained, Interpreter* interpreter) {
+void PostponeElement::Resubmitter::postpone(const Event& event, std::string until, uint64_t timeout, bool chained, InterpreterImpl* interpreter) {
Resubmitter* resubmitter = getInstance(interpreter);
resubmitter->_postponedEvents.push_back(Postponed(event, until, timeout, chained));
}
-void PostponeElement::Resubmitter::onStableConfiguration(Interpreter* interpreter) {
+void PostponeElement::Resubmitter::onStableConfiguration(Interpreter interpreter) {
std::list<Postponed>::iterator eventIter = _postponedEvents.begin();
bool dispatched = false;
while(eventIter != _postponedEvents.end()) {
try {
// LOG(INFO) << "Reevaluating: >> " << eventIter->first << " <<";
- if ((!dispatched || eventIter->chaining) && interpreter->getDataModel().evalAsBool(eventIter->until)) {
+ if ((!dispatched || eventIter->chaining) && interpreter.getDataModel().evalAsBool(eventIter->until)) {
// LOG(INFO) << " -> is TRUE";
eventIter->event.name += ".postponed";
- interpreter->receive(eventIter->event, true);
+ interpreter.receive(eventIter->event, true);
_postponedEvents.erase(eventIter);
dispatched = true;
}
@@ -127,21 +127,21 @@ void PostponeElement::Resubmitter::onStableConfiguration(Interpreter* interprete
}
-void PostponeElement::Resubmitter::afterCompletion(Interpreter* interpreter) {
+void PostponeElement::Resubmitter::afterCompletion(Interpreter interpreter) {
tthread::lock_guard<tthread::recursive_mutex> lock(PostponeElement::Resubmitter::_accessLock);
_instances.erase(interpreter);
delete this; // committing suicide is ok if we are careful
}
-std::map<Interpreter*, PostponeElement::Resubmitter*> PostponeElement::Resubmitter::_instances;
+std::map<Interpreter, PostponeElement::Resubmitter*> PostponeElement::Resubmitter::_instances;
tthread::recursive_mutex PostponeElement::Resubmitter::_accessLock;
-PostponeElement::Resubmitter* PostponeElement::Resubmitter::getInstance(Interpreter* interpreter) {
+PostponeElement::Resubmitter* PostponeElement::Resubmitter::getInstance(InterpreterImpl* interpreter) {
tthread::lock_guard<tthread::recursive_mutex> lock(PostponeElement::Resubmitter::_accessLock);
- if (_instances.find(interpreter) == _instances.end()) {
- _instances[interpreter] = new Resubmitter(interpreter);
+ if (_instances.find(interpreter->shared_from_this()) == _instances.end()) {
+ _instances[interpreter->shared_from_this()] = new Resubmitter(interpreter);
}
- return _instances[interpreter];
+ return _instances[interpreter->shared_from_this()];
}
} \ No newline at end of file
diff --git a/src/uscxml/plugins/element/postpone/PostponeElement.h b/src/uscxml/plugins/element/postpone/PostponeElement.h
index 7886415..f0c42c0 100644
--- a/src/uscxml/plugins/element/postpone/PostponeElement.h
+++ b/src/uscxml/plugins/element/postpone/PostponeElement.h
@@ -23,7 +23,7 @@ public:
PostponeElement() {}
virtual ~PostponeElement() {}
- boost::shared_ptr<ExecutableContentImpl> create(Interpreter* interpreter);
+ boost::shared_ptr<ExecutableContentImpl> create(InterpreterImpl* interpreter);
std::string getLocalName() {
return "postpone";
@@ -44,19 +44,19 @@ protected:
// once per interpreter
class Resubmitter : public InterpreterMonitor {
public:
- Resubmitter(Interpreter* interpreter) {
+ Resubmitter(InterpreterImpl* interpreter) {
interpreter->addMonitor(this);
}
- static Resubmitter* getInstance(Interpreter* interpreter);
- static void postpone(const Event& event, std::string until, uint64_t timeout, bool chained, Interpreter* interpreter);
+ static Resubmitter* getInstance(InterpreterImpl* interpreter);
+ static void postpone(const Event& event, std::string until, uint64_t timeout, bool chained, InterpreterImpl* interpreter);
// InterpreterMonitor
- void onStableConfiguration(Interpreter* interpreter);
- void afterCompletion(Interpreter* interpreter);
+ void onStableConfiguration(Interpreter interpreter);
+ void afterCompletion(Interpreter interpreter);
std::list<Postponed> _postponedEvents;
- static std::map<Interpreter*, Resubmitter*> _instances;
+ static std::map<Interpreter, Resubmitter*> _instances;
static tthread::recursive_mutex _accessLock;
};
diff --git a/src/uscxml/plugins/element/response/ResponseElement.cpp b/src/uscxml/plugins/element/response/ResponseElement.cpp
index cd7ef2d..675bc1e 100644
--- a/src/uscxml/plugins/element/response/ResponseElement.cpp
+++ b/src/uscxml/plugins/element/response/ResponseElement.cpp
@@ -16,7 +16,7 @@ bool connect(pluma::Host& host) {
}
#endif
-boost::shared_ptr<ExecutableContentImpl> ResponseElement::create(Interpreter* interpreter) {
+boost::shared_ptr<ExecutableContentImpl> ResponseElement::create(InterpreterImpl* interpreter) {
boost::shared_ptr<ResponseElement> invoker = boost::shared_ptr<ResponseElement>(new ResponseElement());
invoker->_interpreter = interpreter;
return invoker;
diff --git a/src/uscxml/plugins/element/response/ResponseElement.h b/src/uscxml/plugins/element/response/ResponseElement.h
index de3991c..333dd98 100644
--- a/src/uscxml/plugins/element/response/ResponseElement.h
+++ b/src/uscxml/plugins/element/response/ResponseElement.h
@@ -13,7 +13,7 @@ class ResponseElement : public ExecutableContentImpl {
public:
ResponseElement() {}
virtual ~ResponseElement() {}
- boost::shared_ptr<ExecutableContentImpl> create(Interpreter* interpreter);
+ boost::shared_ptr<ExecutableContentImpl> create(InterpreterImpl* interpreter);
std::string getLocalName() {
return "response";
diff --git a/src/uscxml/plugins/invoker/ffmpeg/FFMPEGInvoker.cpp b/src/uscxml/plugins/invoker/ffmpeg/FFMPEGInvoker.cpp
index 05af363..aaf6bc4 100644
--- a/src/uscxml/plugins/invoker/ffmpeg/FFMPEGInvoker.cpp
+++ b/src/uscxml/plugins/invoker/ffmpeg/FFMPEGInvoker.cpp
@@ -24,7 +24,7 @@ FFMPEGInvoker::FFMPEGInvoker() {
FFMPEGInvoker::~FFMPEGInvoker() {
};
-boost::shared_ptr<IOProcessorImpl> FFMPEGInvoker::create(Interpreter* interpreter) {
+boost::shared_ptr<IOProcessorImpl> FFMPEGInvoker::create(InterpreterImpl* interpreter) {
boost::shared_ptr<FFMPEGInvoker> invoker = boost::shared_ptr<FFMPEGInvoker>(new FFMPEGInvoker());
invoker->_interpreter = interpreter;
return invoker;
diff --git a/src/uscxml/plugins/invoker/ffmpeg/FFMPEGInvoker.h b/src/uscxml/plugins/invoker/ffmpeg/FFMPEGInvoker.h
index 734467f..972c4ff 100644
--- a/src/uscxml/plugins/invoker/ffmpeg/FFMPEGInvoker.h
+++ b/src/uscxml/plugins/invoker/ffmpeg/FFMPEGInvoker.h
@@ -13,7 +13,7 @@ class FFMPEGInvoker : public InvokerImpl {
public:
FFMPEGInvoker();
virtual ~FFMPEGInvoker();
- virtual boost::shared_ptr<IOProcessorImpl> create(Interpreter* interpreter);
+ virtual boost::shared_ptr<IOProcessorImpl> create(InterpreterImpl* interpreter);
virtual std::set<std::string> getNames() {
std::set<std::string> names;
diff --git a/src/uscxml/plugins/invoker/filesystem/dirmon/DirMonInvoker.cpp b/src/uscxml/plugins/invoker/filesystem/dirmon/DirMonInvoker.cpp
index 65ea531..b2a16f3 100644
--- a/src/uscxml/plugins/invoker/filesystem/dirmon/DirMonInvoker.cpp
+++ b/src/uscxml/plugins/invoker/filesystem/dirmon/DirMonInvoker.cpp
@@ -37,7 +37,7 @@ DirMonInvoker::~DirMonInvoker() {
_thread->join();
};
-boost::shared_ptr<IOProcessorImpl> DirMonInvoker::create(Interpreter* interpreter) {
+boost::shared_ptr<IOProcessorImpl> DirMonInvoker::create(InterpreterImpl* interpreter) {
boost::shared_ptr<DirMonInvoker> invoker = boost::shared_ptr<DirMonInvoker>(new DirMonInvoker());
invoker->_interpreter = interpreter;
return invoker;
diff --git a/src/uscxml/plugins/invoker/filesystem/dirmon/DirMonInvoker.h b/src/uscxml/plugins/invoker/filesystem/dirmon/DirMonInvoker.h
index e2abf54..a58da10 100644
--- a/src/uscxml/plugins/invoker/filesystem/dirmon/DirMonInvoker.h
+++ b/src/uscxml/plugins/invoker/filesystem/dirmon/DirMonInvoker.h
@@ -56,7 +56,7 @@ class DirMonInvoker : public InvokerImpl, public DirectoryWatchMonitor {
public:
DirMonInvoker();
virtual ~DirMonInvoker();
- virtual boost::shared_ptr<IOProcessorImpl> create(Interpreter* interpreter);
+ virtual boost::shared_ptr<IOProcessorImpl> create(InterpreterImpl* interpreter);
virtual std::set<std::string> getNames() {
std::set<std::string> names;
diff --git a/src/uscxml/plugins/invoker/graphics/openscenegraph/OSGInvoker.cpp b/src/uscxml/plugins/invoker/graphics/openscenegraph/OSGInvoker.cpp
index 3b1a828..932452e 100644
--- a/src/uscxml/plugins/invoker/graphics/openscenegraph/OSGInvoker.cpp
+++ b/src/uscxml/plugins/invoker/graphics/openscenegraph/OSGInvoker.cpp
@@ -22,7 +22,7 @@ OSGInvoker::OSGInvoker() {
OSGInvoker::~OSGInvoker() {
};
-boost::shared_ptr<IOProcessorImpl> OSGInvoker::create(Interpreter* interpreter) {
+boost::shared_ptr<IOProcessorImpl> OSGInvoker::create(InterpreterImpl* interpreter) {
boost::shared_ptr<OSGInvoker> invoker = boost::shared_ptr<OSGInvoker> (new OSGInvoker());
invoker->_interpreter = interpreter;
return invoker;
diff --git a/src/uscxml/plugins/invoker/graphics/openscenegraph/OSGInvoker.h b/src/uscxml/plugins/invoker/graphics/openscenegraph/OSGInvoker.h
index acfa55c..e79b250 100644
--- a/src/uscxml/plugins/invoker/graphics/openscenegraph/OSGInvoker.h
+++ b/src/uscxml/plugins/invoker/graphics/openscenegraph/OSGInvoker.h
@@ -20,7 +20,7 @@ class OSGInvoker : public InvokerImpl, public Arabica::DOM::Events::EventListene
public:
OSGInvoker();
virtual ~OSGInvoker();
- virtual boost::shared_ptr<IOProcessorImpl> create(Interpreter* interpreter);
+ virtual boost::shared_ptr<IOProcessorImpl> create(InterpreterImpl* interpreter);
virtual std::set<std::string> getNames() {
std::set<std::string> names;
diff --git a/src/uscxml/plugins/invoker/graphics/openscenegraph/converter/OSGConverter.cpp b/src/uscxml/plugins/invoker/graphics/openscenegraph/converter/OSGConverter.cpp
index 93a238c..de39424 100644
--- a/src/uscxml/plugins/invoker/graphics/openscenegraph/converter/OSGConverter.cpp
+++ b/src/uscxml/plugins/invoker/graphics/openscenegraph/converter/OSGConverter.cpp
@@ -52,7 +52,7 @@ OSGConverter::~OSGConverter() {
}
};
-boost::shared_ptr<IOProcessorImpl> OSGConverter::create(Interpreter* interpreter) {
+boost::shared_ptr<IOProcessorImpl> OSGConverter::create(InterpreterImpl* interpreter) {
boost::shared_ptr<OSGConverter> invoker = boost::shared_ptr<OSGConverter>(new OSGConverter());
invoker->_interpreter = interpreter;
return invoker;
diff --git a/src/uscxml/plugins/invoker/graphics/openscenegraph/converter/OSGConverter.h b/src/uscxml/plugins/invoker/graphics/openscenegraph/converter/OSGConverter.h
index 28c908d..d3cee30 100644
--- a/src/uscxml/plugins/invoker/graphics/openscenegraph/converter/OSGConverter.h
+++ b/src/uscxml/plugins/invoker/graphics/openscenegraph/converter/OSGConverter.h
@@ -15,7 +15,7 @@ class OSGConverter : public InvokerImpl {
public:
OSGConverter();
virtual ~OSGConverter();
- virtual boost::shared_ptr<IOProcessorImpl> create(Interpreter* interpreter);
+ virtual boost::shared_ptr<IOProcessorImpl> create(InterpreterImpl* interpreter);
virtual std::set<std::string> getNames() {
std::set<std::string> names;
diff --git a/src/uscxml/plugins/invoker/heartbeat/HeartbeatInvoker.cpp b/src/uscxml/plugins/invoker/heartbeat/HeartbeatInvoker.cpp
index 6371a43..b69f569 100644
--- a/src/uscxml/plugins/invoker/heartbeat/HeartbeatInvoker.cpp
+++ b/src/uscxml/plugins/invoker/heartbeat/HeartbeatInvoker.cpp
@@ -22,7 +22,7 @@ HeartbeatInvoker::~HeartbeatInvoker() {
cancel("");
};
-boost::shared_ptr<IOProcessorImpl> HeartbeatInvoker::create(Interpreter* interpreter) {
+boost::shared_ptr<IOProcessorImpl> HeartbeatInvoker::create(InterpreterImpl* interpreter) {
boost::shared_ptr<HeartbeatInvoker> invoker = boost::shared_ptr<HeartbeatInvoker>(new HeartbeatInvoker());
invoker->_interpreter = interpreter;
return invoker;
diff --git a/src/uscxml/plugins/invoker/heartbeat/HeartbeatInvoker.h b/src/uscxml/plugins/invoker/heartbeat/HeartbeatInvoker.h
index 11be295..5a6272e 100644
--- a/src/uscxml/plugins/invoker/heartbeat/HeartbeatInvoker.h
+++ b/src/uscxml/plugins/invoker/heartbeat/HeartbeatInvoker.h
@@ -13,7 +13,7 @@ class HeartbeatInvoker : public InvokerImpl {
public:
HeartbeatInvoker();
virtual ~HeartbeatInvoker();
- virtual boost::shared_ptr<IOProcessorImpl> create(Interpreter* interpreter);
+ virtual boost::shared_ptr<IOProcessorImpl> create(InterpreterImpl* interpreter);
virtual std::set<std::string> getNames() {
std::set<std::string> names;
diff --git a/src/uscxml/plugins/invoker/http/HTTPServletInvoker.cpp b/src/uscxml/plugins/invoker/http/HTTPServletInvoker.cpp
index 223fe03..03e62bd 100644
--- a/src/uscxml/plugins/invoker/http/HTTPServletInvoker.cpp
+++ b/src/uscxml/plugins/invoker/http/HTTPServletInvoker.cpp
@@ -25,7 +25,7 @@ HTTPServletInvoker::~HTTPServletInvoker() {
};
-boost::shared_ptr<IOProcessorImpl> HTTPServletInvoker::create(Interpreter* interpreter) {
+boost::shared_ptr<IOProcessorImpl> HTTPServletInvoker::create(InterpreterImpl* interpreter) {
boost::shared_ptr<HTTPServletInvoker> invoker = boost::shared_ptr<HTTPServletInvoker>(new HTTPServletInvoker());
invoker->_interpreter = interpreter;
return invoker;
diff --git a/src/uscxml/plugins/invoker/http/HTTPServletInvoker.h b/src/uscxml/plugins/invoker/http/HTTPServletInvoker.h
index 229ead5..06a286c 100644
--- a/src/uscxml/plugins/invoker/http/HTTPServletInvoker.h
+++ b/src/uscxml/plugins/invoker/http/HTTPServletInvoker.h
@@ -14,7 +14,7 @@ class HTTPServletInvoker : public InvokerImpl, public HTTPServlet {
public:
HTTPServletInvoker();
virtual ~HTTPServletInvoker();
- virtual boost::shared_ptr<IOProcessorImpl> create(Interpreter* interpreter);
+ virtual boost::shared_ptr<IOProcessorImpl> create(InterpreterImpl* interpreter);
virtual std::set<std::string> getNames() {
std::set<std::string> names;
diff --git a/src/uscxml/plugins/invoker/miles/MilesSessionInvoker.cpp b/src/uscxml/plugins/invoker/miles/MilesSessionInvoker.cpp
index 1a1416a..786c196 100644
--- a/src/uscxml/plugins/invoker/miles/MilesSessionInvoker.cpp
+++ b/src/uscxml/plugins/invoker/miles/MilesSessionInvoker.cpp
@@ -25,7 +25,7 @@ MilesSessionInvoker::MilesSessionInvoker() {
MilesSessionInvoker::~MilesSessionInvoker() {
};
-boost::shared_ptr<IOProcessorImpl> MilesSessionInvoker::create(Interpreter* interpreter) {
+boost::shared_ptr<IOProcessorImpl> MilesSessionInvoker::create(InterpreterImpl* interpreter) {
boost::shared_ptr<MilesSessionInvoker> invoker = boost::shared_ptr<MilesSessionInvoker>(new MilesSessionInvoker());
invoker->_interpreter = interpreter;
return invoker;
diff --git a/src/uscxml/plugins/invoker/miles/MilesSessionInvoker.h b/src/uscxml/plugins/invoker/miles/MilesSessionInvoker.h
index fa66038..c552d1f 100644
--- a/src/uscxml/plugins/invoker/miles/MilesSessionInvoker.h
+++ b/src/uscxml/plugins/invoker/miles/MilesSessionInvoker.h
@@ -24,7 +24,7 @@ class MilesSessionInvoker : public InvokerImpl {
public:
MilesSessionInvoker();
virtual ~MilesSessionInvoker();
- virtual boost::shared_ptr<IOProcessorImpl> create(Interpreter* interpreter);
+ virtual boost::shared_ptr<IOProcessorImpl> create(InterpreterImpl* interpreter);
virtual std::set<std::string> getNames() {
std::set<std::string> names;
diff --git a/src/uscxml/plugins/invoker/sample/SampleInvoker.cpp b/src/uscxml/plugins/invoker/sample/SampleInvoker.cpp
index e7c2e10..d226784 100644
--- a/src/uscxml/plugins/invoker/sample/SampleInvoker.cpp
+++ b/src/uscxml/plugins/invoker/sample/SampleInvoker.cpp
@@ -21,7 +21,7 @@ SampleInvoker::SampleInvoker() {
SampleInvoker::~SampleInvoker() {
};
-boost::shared_ptr<IOProcessorImpl> SampleInvoker::create(Interpreter* interpreter) {
+boost::shared_ptr<IOProcessorImpl> SampleInvoker::create(InterpreterImpl* interpreter) {
boost::shared_ptr<SampleInvoker> invoker = boost::shared_ptr<SampleInvoker>(new SampleInvoker());
invoker->_interpreter = interpreter;
return invoker;
diff --git a/src/uscxml/plugins/invoker/sample/SampleInvoker.h b/src/uscxml/plugins/invoker/sample/SampleInvoker.h
index d689bda..9261f2e 100644
--- a/src/uscxml/plugins/invoker/sample/SampleInvoker.h
+++ b/src/uscxml/plugins/invoker/sample/SampleInvoker.h
@@ -13,7 +13,7 @@ class SampleInvoker : public InvokerImpl {
public:
SampleInvoker();
virtual ~SampleInvoker();
- virtual boost::shared_ptr<IOProcessorImpl> create(Interpreter* interpreter);
+ virtual boost::shared_ptr<IOProcessorImpl> create(InterpreterImpl* interpreter);
virtual std::set<std::string> getNames() {
std::set<std::string> names;
diff --git a/src/uscxml/plugins/invoker/scxml/USCXMLInvoker.cpp b/src/uscxml/plugins/invoker/scxml/USCXMLInvoker.cpp
index a142231..fc2ac2b 100644
--- a/src/uscxml/plugins/invoker/scxml/USCXMLInvoker.cpp
+++ b/src/uscxml/plugins/invoker/scxml/USCXMLInvoker.cpp
@@ -21,10 +21,9 @@ USCXMLInvoker::USCXMLInvoker() : _cancelled(false) {
USCXMLInvoker::~USCXMLInvoker() {
_cancelled = true;
- delete _invokedInterpreter;
};
-boost::shared_ptr<IOProcessorImpl> USCXMLInvoker::create(Interpreter* interpreter) {
+boost::shared_ptr<IOProcessorImpl> USCXMLInvoker::create(InterpreterImpl* interpreter) {
boost::shared_ptr<USCXMLInvoker> invoker = boost::shared_ptr<USCXMLInvoker>(new USCXMLInvoker());
invoker->_parentInterpreter = interpreter;
return invoker;
@@ -36,7 +35,7 @@ Data USCXMLInvoker::getDataModelVariables() {
}
void USCXMLInvoker::send(const SendRequest& req) {
- _invokedInterpreter->_externalQueue.push(req);
+ _invokedInterpreter.getImpl()->_externalQueue.push(req);
}
void USCXMLInvoker::cancel(const std::string sendId) {
@@ -54,27 +53,27 @@ void USCXMLInvoker::invoke(const InvokeRequest& req) {
LOG(ERROR) << "Cannot invoke nested SCXML interpreter, neither src attribute nor DOM is given";
}
if (_invokedInterpreter) {
- DataModel dataModel(_invokedInterpreter->getDataModel());
+ DataModel dataModel(_invokedInterpreter.getImpl()->getDataModel());
if (dataModel) {
}
- _invokedInterpreter->setParentQueue(this);
+ _invokedInterpreter.getImpl()->setParentQueue(this);
// transfer namespace prefixes
- _invokedInterpreter->_nsURL = _parentInterpreter->_nsURL;
- _invokedInterpreter->_xpathPrefix = _parentInterpreter->_xpathPrefix;
- _invokedInterpreter->_nsToPrefix = _parentInterpreter->_nsToPrefix;
+ _invokedInterpreter.getImpl()->_nsURL = _parentInterpreter->_nsURL;
+ _invokedInterpreter.getImpl()->_xpathPrefix = _parentInterpreter->_xpathPrefix;
+ _invokedInterpreter.getImpl()->_nsToPrefix = _parentInterpreter->_nsToPrefix;
std::map<std::string, std::string>::iterator nsIter = _parentInterpreter->_nsToPrefix.begin();
while(nsIter != _parentInterpreter->_nsToPrefix.end()) {
- _invokedInterpreter->_nsContext.addNamespaceDeclaration(nsIter->first, nsIter->second);
+ _invokedInterpreter.getImpl()->_nsContext.addNamespaceDeclaration(nsIter->first, nsIter->second);
nsIter++;
}
- _invokedInterpreter->_xmlNSPrefix = _parentInterpreter->_xmlNSPrefix;
- _invokedInterpreter->_sessionId = req.invokeid;
+ _invokedInterpreter.getImpl()->_xmlNSPrefix = _parentInterpreter->_xmlNSPrefix;
+ _invokedInterpreter.getImpl()->_sessionId = req.invokeid;
/// test240 assumes that invoke request params will carry over to the datamodel
- _invokedInterpreter->setInvokeRequest(req);
+ _invokedInterpreter.getImpl()->setInvokeRequest(req);
- _invokedInterpreter->start();
+ _invokedInterpreter.getImpl()->start();
} else {
/// test 530
_parentInterpreter->receive(Event("done.invoke." + _invokeId, Event::PLATFORM));
diff --git a/src/uscxml/plugins/invoker/scxml/USCXMLInvoker.h b/src/uscxml/plugins/invoker/scxml/USCXMLInvoker.h
index b1386b1..4b2c2d5 100644
--- a/src/uscxml/plugins/invoker/scxml/USCXMLInvoker.h
+++ b/src/uscxml/plugins/invoker/scxml/USCXMLInvoker.h
@@ -20,7 +20,7 @@ class USCXMLInvoker :
public:
USCXMLInvoker();
virtual ~USCXMLInvoker();
- virtual boost::shared_ptr<IOProcessorImpl> create(Interpreter* interpreter);
+ virtual boost::shared_ptr<IOProcessorImpl> create(InterpreterImpl* interpreter);
virtual std::set<std::string> getNames() {
std::set<std::string> names;
names.insert("scxml");
@@ -39,8 +39,8 @@ public:
protected:
bool _cancelled;
- Interpreter* _invokedInterpreter;
- Interpreter* _parentInterpreter;
+ Interpreter _invokedInterpreter;
+ InterpreterImpl* _parentInterpreter;
};
#ifdef BUILD_AS_PLUGINS
diff --git a/src/uscxml/plugins/invoker/sqlite3/Sqlite3Invoker.cpp b/src/uscxml/plugins/invoker/sqlite3/Sqlite3Invoker.cpp
index e217eaa..1d563ec 100644
--- a/src/uscxml/plugins/invoker/sqlite3/Sqlite3Invoker.cpp
+++ b/src/uscxml/plugins/invoker/sqlite3/Sqlite3Invoker.cpp
@@ -21,7 +21,7 @@ Sqlite3Invoker::Sqlite3Invoker() {
Sqlite3Invoker::~Sqlite3Invoker() {
};
-boost::shared_ptr<IOProcessorImpl> Sqlite3Invoker::create(Interpreter* interpreter) {
+boost::shared_ptr<IOProcessorImpl> Sqlite3Invoker::create(InterpreterImpl* interpreter) {
boost::shared_ptr<Sqlite3Invoker> invoker = boost::shared_ptr<Sqlite3Invoker>(new Sqlite3Invoker());
invoker->_interpreter = interpreter;
return invoker;
diff --git a/src/uscxml/plugins/invoker/sqlite3/Sqlite3Invoker.h b/src/uscxml/plugins/invoker/sqlite3/Sqlite3Invoker.h
index 505d263..35bfec4 100644
--- a/src/uscxml/plugins/invoker/sqlite3/Sqlite3Invoker.h
+++ b/src/uscxml/plugins/invoker/sqlite3/Sqlite3Invoker.h
@@ -13,7 +13,7 @@ class Sqlite3Invoker : public InvokerImpl {
public:
Sqlite3Invoker();
virtual ~Sqlite3Invoker();
- virtual boost::shared_ptr<IOProcessorImpl> create(Interpreter* interpreter);
+ virtual boost::shared_ptr<IOProcessorImpl> create(InterpreterImpl* interpreter);
virtual std::set<std::string> getNames() {
std::set<std::string> names;
diff --git a/src/uscxml/plugins/invoker/system/SystemInvoker.cpp b/src/uscxml/plugins/invoker/system/SystemInvoker.cpp
index 492d6d3..468628c 100644
--- a/src/uscxml/plugins/invoker/system/SystemInvoker.cpp
+++ b/src/uscxml/plugins/invoker/system/SystemInvoker.cpp
@@ -21,7 +21,7 @@ SystemInvoker::SystemInvoker() {
SystemInvoker::~SystemInvoker() {
};
-boost::shared_ptr<IOProcessorImpl> SystemInvoker::create(Interpreter* interpreter) {
+boost::shared_ptr<IOProcessorImpl> SystemInvoker::create(InterpreterImpl* interpreter) {
boost::shared_ptr<SystemInvoker> invoker = boost::shared_ptr<SystemInvoker>(new SystemInvoker());
invoker->_interpreter = interpreter;
return invoker;
diff --git a/src/uscxml/plugins/invoker/system/SystemInvoker.h b/src/uscxml/plugins/invoker/system/SystemInvoker.h
index 67bd1a9..0292d41 100644
--- a/src/uscxml/plugins/invoker/system/SystemInvoker.h
+++ b/src/uscxml/plugins/invoker/system/SystemInvoker.h
@@ -13,7 +13,7 @@ class SystemInvoker : public InvokerImpl {
public:
SystemInvoker();
virtual ~SystemInvoker();
- virtual boost::shared_ptr<IOProcessorImpl> create(Interpreter* interpreter);
+ virtual boost::shared_ptr<IOProcessorImpl> create(InterpreterImpl* interpreter);
virtual std::set<std::string> getNames() {
std::set<std::string> names;
diff --git a/src/uscxml/plugins/invoker/umundo/UmundoInvoker.cpp b/src/uscxml/plugins/invoker/umundo/UmundoInvoker.cpp
index 4005d03..5439413 100644
--- a/src/uscxml/plugins/invoker/umundo/UmundoInvoker.cpp
+++ b/src/uscxml/plugins/invoker/umundo/UmundoInvoker.cpp
@@ -28,7 +28,7 @@ UmundoInvoker::~UmundoInvoker() {
}
};
-boost::shared_ptr<IOProcessorImpl> UmundoInvoker::create(Interpreter* interpreter) {
+boost::shared_ptr<IOProcessorImpl> UmundoInvoker::create(InterpreterImpl* interpreter) {
boost::shared_ptr<UmundoInvoker> invoker = boost::shared_ptr<UmundoInvoker>(new UmundoInvoker());
invoker->_interpreter = interpreter;
return invoker;
@@ -250,7 +250,7 @@ void UmundoInvoker::changed(umundo::ServiceDescription desc) {
}
std::multimap<std::string, std::pair<std::string, umundo::Node*> > UmundoInvoker::_nodes;
-umundo::Node* UmundoInvoker::getNode(Interpreter* interpreter, const std::string& domain) {
+umundo::Node* UmundoInvoker::getNode(InterpreterImpl* interpreter, const std::string& domain) {
std::pair<_nodes_t::iterator, _nodes_t::iterator> range = _nodes.equal_range(interpreter->getName());
for (_nodes_t::iterator it = range.first; it != range.second; it++) {
if (it->second.first.compare(domain) == 0)
diff --git a/src/uscxml/plugins/invoker/umundo/UmundoInvoker.h b/src/uscxml/plugins/invoker/umundo/UmundoInvoker.h
index a7f45f1..db944cd 100644
--- a/src/uscxml/plugins/invoker/umundo/UmundoInvoker.h
+++ b/src/uscxml/plugins/invoker/umundo/UmundoInvoker.h
@@ -20,7 +20,7 @@ class UmundoInvoker : public InvokerImpl, public umundo::TypedReceiver, public u
public:
UmundoInvoker();
virtual ~UmundoInvoker();
- virtual boost::shared_ptr<IOProcessorImpl> create(Interpreter* interpreter);
+ virtual boost::shared_ptr<IOProcessorImpl> create(InterpreterImpl* interpreter);
virtual std::set<std::string> getNames() {
std::set<std::string> names;
@@ -57,7 +57,7 @@ protected:
static std::multimap<std::string, std::pair<std::string, umundo::Node*> > _nodes;
typedef std::multimap<std::string, std::pair<std::string, umundo::Node*> > _nodes_t;
- static umundo::Node* getNode(Interpreter* interpreter, const std::string& domain);
+ static umundo::Node* getNode(InterpreterImpl* interpreter, const std::string& domain);
};
#ifdef BUILD_AS_PLUGINS
diff --git a/src/uscxml/plugins/ioprocessor/basichttp/libevent/EventIOProcessor.cpp b/src/uscxml/plugins/ioprocessor/basichttp/BasicHTTPIOProcessor.cpp
index a1f803d..9ae62a8 100644
--- a/src/uscxml/plugins/ioprocessor/basichttp/libevent/EventIOProcessor.cpp
+++ b/src/uscxml/plugins/ioprocessor/basichttp/BasicHTTPIOProcessor.cpp
@@ -3,7 +3,7 @@
#include <windows.h>
#endif
-#include "uscxml/plugins/ioprocessor/basichttp/libevent/EventIOProcessor.h"
+#include "uscxml/plugins/ioprocessor/basichttp/BasicHTTPIOProcessor.h"
#include "uscxml/Message.h"
#include <iostream>
#include <event2/dns.h>
@@ -29,24 +29,24 @@ namespace uscxml {
#ifdef BUILD_AS_PLUGINS
PLUMA_CONNECTOR
bool connect(pluma::Host& host) {
- host.add( new EventIOProcessorProvider() );
+ host.add( new BasicHTTPIOProcessorProvider() );
return true;
}
#endif
// see http://www.w3.org/TR/scxml/#BasicHTTPEventProcessor
-EventIOProcessor::EventIOProcessor() {
+BasicHTTPIOProcessor::BasicHTTPIOProcessor() {
}
-EventIOProcessor::~EventIOProcessor() {
+BasicHTTPIOProcessor::~BasicHTTPIOProcessor() {
HTTPServer* httpServer = HTTPServer::getInstance();
httpServer->unregisterServlet(this);
}
-boost::shared_ptr<IOProcessorImpl> EventIOProcessor::create(Interpreter* interpreter) {
- boost::shared_ptr<EventIOProcessor> io = boost::shared_ptr<EventIOProcessor>(new EventIOProcessor());
+boost::shared_ptr<IOProcessorImpl> BasicHTTPIOProcessor::create(InterpreterImpl* interpreter) {
+ boost::shared_ptr<BasicHTTPIOProcessor> io = boost::shared_ptr<BasicHTTPIOProcessor>(new BasicHTTPIOProcessor());
io->_interpreter = interpreter;
// register at http server
@@ -61,14 +61,14 @@ boost::shared_ptr<IOProcessorImpl> EventIOProcessor::create(Interpreter* interpr
return io;
}
-Data EventIOProcessor::getDataModelVariables() {
+Data BasicHTTPIOProcessor::getDataModelVariables() {
Data data;
assert(_url.length() > 0);
data.compound["location"] = Data(_url, Data::VERBATIM);
return data;
}
-void EventIOProcessor::httpRecvRequest(const HTTPServer::Request& req) {
+void BasicHTTPIOProcessor::httpRecvRequest(const HTTPServer::Request& req) {
Event reqEvent = req;
reqEvent.type = Event::EXTERNAL;
bool scxmlStructFound = false;
@@ -116,7 +116,7 @@ void EventIOProcessor::httpRecvRequest(const HTTPServer::Request& req) {
evhttp_send_reply(req.curlReq, 200, "OK", NULL);
}
-void EventIOProcessor::send(const SendRequest& req) {
+void BasicHTTPIOProcessor::send(const SendRequest& req) {
bool isLocal = false;
std::string target;
@@ -167,9 +167,9 @@ void EventIOProcessor::send(const SendRequest& req) {
}
}
-void EventIOProcessor::downloadStarted(const URL& url) {}
+void BasicHTTPIOProcessor::downloadStarted(const URL& url) {}
-void EventIOProcessor::downloadCompleted(const URL& url) {
+void BasicHTTPIOProcessor::downloadCompleted(const URL& url) {
std::map<std::string, std::pair<URL, SendRequest> >::iterator reqIter = _sendRequests.begin();
while(reqIter != _sendRequests.end()) {
if (reqIter->second.first == url) {
@@ -181,7 +181,7 @@ void EventIOProcessor::downloadCompleted(const URL& url) {
assert(false);
}
-void EventIOProcessor::downloadFailed(const URL& url, int errorCode) {
+void BasicHTTPIOProcessor::downloadFailed(const URL& url, int errorCode) {
std::map<std::string, std::pair<URL, SendRequest> >::iterator reqIter = _sendRequests.begin();
while(reqIter != _sendRequests.end()) {
diff --git a/src/uscxml/plugins/ioprocessor/basichttp/libevent/EventIOProcessor.h b/src/uscxml/plugins/ioprocessor/basichttp/BasicHTTPIOProcessor.h
index c549b2b..1848e5e 100644
--- a/src/uscxml/plugins/ioprocessor/basichttp/libevent/EventIOProcessor.h
+++ b/src/uscxml/plugins/ioprocessor/basichttp/BasicHTTPIOProcessor.h
@@ -1,5 +1,5 @@
-#ifndef EVENTIOPROCESSOR_H_2CUY93KU
-#define EVENTIOPROCESSOR_H_2CUY93KU
+#ifndef BASICHTTPIOPROCESSOR_H_2CUY93KU
+#define BASICHTTPIOPROCESSOR_H_2CUY93KU
#include "uscxml/concurrency/eventqueue/DelayedEventQueue.h"
#include "uscxml/server/HTTPServer.h"
@@ -18,13 +18,11 @@
namespace uscxml {
-class EventIOServer;
-
-class EventIOProcessor : public IOProcessorImpl, public HTTPServlet, public URLMonitor {
+class BasicHTTPIOProcessor : public IOProcessorImpl, public HTTPServlet, public URLMonitor {
public:
- EventIOProcessor();
- virtual ~EventIOProcessor();
- virtual boost::shared_ptr<IOProcessorImpl> create(uscxml::Interpreter* interpreter);
+ BasicHTTPIOProcessor();
+ virtual ~BasicHTTPIOProcessor();
+ virtual boost::shared_ptr<IOProcessorImpl> create(uscxml::InterpreterImpl* interpreter);
virtual std::set<std::string> getNames() {
std::set<std::string> names;
@@ -58,9 +56,9 @@ protected:
};
#ifdef BUILD_AS_PLUGINS
-PLUMA_INHERIT_PROVIDER(EventIOProcessor, IOProcessorImpl);
+PLUMA_INHERIT_PROVIDER(BasicHTTPIOProcessor, IOProcessorImpl);
#endif
}
-#endif /* end of include guard: EVENTIOPROCESSOR_H_2CUY93KU */ \ No newline at end of file
+#endif /* end of include guard: BASICHTTPIOPROCESSOR_H_2CUY93KU */ \ No newline at end of file
diff --git a/src/uscxml/plugins/ioprocessor/dom/DOMIOProcessor.cpp b/src/uscxml/plugins/ioprocessor/dom/DOMIOProcessor.cpp
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/uscxml/plugins/ioprocessor/dom/DOMIOProcessor.cpp
diff --git a/src/uscxml/plugins/ioprocessor/dom/DOMIOProcessor.h b/src/uscxml/plugins/ioprocessor/dom/DOMIOProcessor.h
new file mode 100644
index 0000000..e69de29
--- /dev/null
+++ b/src/uscxml/plugins/ioprocessor/dom/DOMIOProcessor.h
diff --git a/src/uscxml/plugins/ioprocessor/scxml/SCXMLIOProcessor.cpp b/src/uscxml/plugins/ioprocessor/scxml/SCXMLIOProcessor.cpp
new file mode 100644
index 0000000..387075b
--- /dev/null
+++ b/src/uscxml/plugins/ioprocessor/scxml/SCXMLIOProcessor.cpp
@@ -0,0 +1,141 @@
+#ifdef _WIN32
+#include <winsock2.h>
+#include <windows.h>
+#endif
+
+#include "uscxml/plugins/ioprocessor/scxml/SCXMLIOProcessor.h"
+#include "uscxml/Message.h"
+#include <iostream>
+#include <event2/dns.h>
+#include <event2/buffer.h>
+#include <event2/keyvalq_struct.h>
+
+#include <string.h>
+
+#include <io/uri.hpp>
+#include <glog/logging.h>
+
+#ifndef _WIN32
+#include <netdb.h>
+#include <arpa/inet.h>
+#endif
+
+#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 SCXMLIOProcessorProvider() );
+ return true;
+}
+#endif
+
+// see http://www.w3.org/TR/scxml/#SCXMLEventProcessor
+
+SCXMLIOProcessor::SCXMLIOProcessor() {
+}
+
+SCXMLIOProcessor::~SCXMLIOProcessor() {
+}
+
+
+boost::shared_ptr<IOProcessorImpl> SCXMLIOProcessor::create(InterpreterImpl* interpreter) {
+ boost::shared_ptr<SCXMLIOProcessor> io = boost::shared_ptr<SCXMLIOProcessor>(new SCXMLIOProcessor());
+ io->_interpreter = interpreter;
+
+ // register at http server
+ std::string path = interpreter->getName();
+ int i = 2;
+ while (!HTTPServer::registerServlet(path + "/scxml", io.get())) {
+ std::stringstream ss;
+ ss << interpreter->getName() << i++;
+ path = ss.str();
+ }
+ return io;
+}
+
+Data SCXMLIOProcessor::getDataModelVariables() {
+ Data data;
+ assert(_url.length() > 0);
+ data.compound["location"] = Data(_url, Data::VERBATIM);
+ return data;
+}
+
+
+void SCXMLIOProcessor::send(const SendRequest& req) {
+ // see http://www.w3.org/TR/scxml/#SendTargets
+
+ SendRequest reqCopy(req);
+ // test 253
+ reqCopy.origintype = "scxml";
+ reqCopy.origin = _url;
+
+ if (false) {
+ } else if (boost::iequals(reqCopy.target, "#_internal")) {
+ /**
+ * #_internal: If the target is the special term '#_internal', the Processor
+ * must add the event to the internal event queue of the sending session.
+ */
+ _interpreter->receiveInternal(reqCopy);
+
+ } else if(reqCopy.target.find_first_of("#_scxml_") == 0) {
+ /**
+ * #_scxml_sessionid: If the target is the special term '#_scxml_sessionid',
+ * where sessionid is the id of an SCXML session that is accessible to the
+ * Processor, the Processor must add the event to the external queue of that
+ * session. The set of SCXML sessions that are accessible to a given SCXML
+ * Processor is platform-dependent.
+ */
+ std::string sessionId = reqCopy.target.substr(8, reqCopy.target.length() - 8);
+ std::map<std::string, boost::weak_ptr<InterpreterImpl> > instances = Interpreter::getInstances();
+ if (instances.find(sessionId) != instances.end()) {
+ boost::shared_ptr<InterpreterImpl> other = instances[sessionId].lock();
+ other->receive(reqCopy);
+ } else {
+ LOG(ERROR) << "Can not send to scxml session " << sessionId << " - not known" << std::endl;
+ _interpreter->receiveInternal(Event("error.communication", Event::PLATFORM));
+ }
+
+
+ } else if (boost::iequals(reqCopy.target, "#_parent")) {
+ /**
+ * #_parent: If the target is the special term '#_parent', the Processor must
+ * add the event to the external event queue of the SCXML session that invoked
+ * the sending session, if there is one.
+ */
+ if (_interpreter->_parentQueue != NULL) {
+ _interpreter->_parentQueue->push(reqCopy);
+ } else {
+ LOG(ERROR) << "Can not send to parent, we were not invoked" << std::endl;
+ _interpreter->receiveInternal(Event("error.communication", Event::PLATFORM));
+ }
+ } else if (reqCopy.target.find_first_of("#_") == 0) {
+ /**
+ * #_invokeid: If the target is the special term '#_invokeid', where invokeid
+ * is the invokeid of an SCXML session that the sending session has created
+ * by <invoke>, the Processor must add the event to the external queue of that
+ * session.
+ */
+ std::string invokeId = reqCopy.target.substr(2, reqCopy.target.length() - 2);
+ if (_interpreter->_invokers.find(invokeId) != _interpreter->_invokers.end()) {
+ tthread::lock_guard<tthread::recursive_mutex> lock(_interpreter->_mutex);
+ try {
+ _interpreter->_invokers[invokeId].send(reqCopy);
+ } catch(...) {
+ LOG(ERROR) << "Exception caught while sending event to invoker " << invokeId;
+ }
+ } else {
+ LOG(ERROR) << "Can not send to invoked component '" << invokeId << "', no such invokeId" << std::endl;
+ _interpreter->receiveInternal(Event("error.communication", Event::PLATFORM));
+ }
+ } else {
+ }
+}
+
+
+
+} \ No newline at end of file
diff --git a/src/uscxml/plugins/ioprocessor/scxml/SCXMLIOProcessor.h b/src/uscxml/plugins/ioprocessor/scxml/SCXMLIOProcessor.h
new file mode 100644
index 0000000..a4f3f7c
--- /dev/null
+++ b/src/uscxml/plugins/ioprocessor/scxml/SCXMLIOProcessor.h
@@ -0,0 +1,36 @@
+#ifndef SCXMLIOProcessor_H_2CUY93KU
+#define SCXMLIOProcessor_H_2CUY93KU
+
+#include "uscxml/plugins/ioprocessor/basichttp/BasicHTTPIOProcessor.h"
+
+#ifdef BUILD_AS_PLUGINS
+#include "uscxml/plugins/Plugins.h"
+#endif
+
+namespace uscxml {
+
+class SCXMLIOProcessor : public BasicHTTPIOProcessor {
+public:
+ SCXMLIOProcessor();
+ virtual ~SCXMLIOProcessor();
+ virtual boost::shared_ptr<IOProcessorImpl> create(uscxml::InterpreterImpl* interpreter);
+
+ virtual std::set<std::string> getNames() {
+ std::set<std::string> names;
+ names.insert("http://www.w3.org/TR/scxml/#SCXMLEventProcessor");
+ names.insert("scxml");
+ return names;
+ }
+
+ virtual void send(const SendRequest& req);
+
+ Data getDataModelVariables();
+};
+
+#ifdef BUILD_AS_PLUGINS
+PLUMA_INHERIT_PROVIDER(SCXMLIOProcessor, IOProcessorImpl);
+#endif
+
+}
+
+#endif /* end of include guard: SCXMLIOProcessor_H_2CUY93KU */ \ No newline at end of file