summaryrefslogtreecommitdiffstats
path: root/src/uscxml/Factory.cpp
diff options
context:
space:
mode:
authorStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2012-09-16 00:12:32 (GMT)
committerStefan Radomski <radomski@tk.informatik.tu-darmstadt.de>2012-09-16 00:12:32 (GMT)
commitd7211d570f8b78442f35bd9c55808053eb18ecc2 (patch)
tree5f670609b6486e8bf4cad19ca0967d51cb0becb4 /src/uscxml/Factory.cpp
parentaa6c3a1257a29cc5bcf8b94893732ee553f27582 (diff)
downloaduscxml-d7211d570f8b78442f35bd9c55808053eb18ecc2.zip
uscxml-d7211d570f8b78442f35bd9c55808053eb18ecc2.tar.gz
uscxml-d7211d570f8b78442f35bd9c55808053eb18ecc2.tar.bz2
Implemented invoke for nested SCXML instances
Diffstat (limited to 'src/uscxml/Factory.cpp')
-rw-r--r--src/uscxml/Factory.cpp17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/uscxml/Factory.cpp b/src/uscxml/Factory.cpp
index 91da562..ee2a3bd 100644
--- a/src/uscxml/Factory.cpp
+++ b/src/uscxml/Factory.cpp
@@ -2,13 +2,17 @@
#include "uscxml/datamodel/ecmascript/v8/V8DataModel.h"
//#include "uscxml/ioprocessor/basichttp/pion/PionIOProcessor.h"
#include "uscxml/ioprocessor/basichttp/libevent/EventIOProcessor.h"
+#include "uscxml/invoker/scxml/USCXMLInvoker.h"
namespace uscxml {
Factory::Factory() {
_dataModels["ecmascript"] = new V8DataModel();
// _ioProcessors["basichttp"] = new PionIOProcessor();
- _ioProcessors["basichttp"] = new io::libevent::EventIOProcessor();
+ _ioProcessors["basichttp"] = new EventIOProcessor();
+ _ioProcessors["http://www.w3.org/TR/scxml/#SCXMLEventProcessor"] = new EventIOProcessor();
+ _invoker["scxml"] = new USCXMLInvoker();
+ _invoker["http://www.w3.org/TR/scxml/"] = _invoker["scxml"];
}
void Factory::registerIOProcessor(const std::string type, IOProcessor* ioProcessor) {
@@ -23,6 +27,17 @@ namespace uscxml {
getInstance()->_executableContent[tag] = executableContent;
}
+ void Factory::registerInvoker(const std::string type, Invoker* invoker) {
+ getInstance()->_invoker[type] = invoker;
+ }
+
+ Invoker* Factory::getInvoker(const std::string type, Interpreter* interpreter) {
+ if (Factory::getInstance()->_invoker.find(type) != getInstance()->_invoker.end()) {
+ return (Invoker*)getInstance()->_invoker[type]->create(interpreter);
+ }
+ return NULL;
+ }
+
DataModel* Factory::getDataModel(const std::string type, Interpreter* interpreter) {
if (Factory::getInstance()->_dataModels.find(type) != getInstance()->_dataModels.end()) {
return getInstance()->_dataModels[type]->create(interpreter);