summaryrefslogtreecommitdiffstats
path: root/src/uscxml/plugins/Factory.cpp
diff options
context:
space:
mode:
authorStefan Radomski <github@mintwerk.de>2017-07-03 15:04:26 (GMT)
committerStefan Radomski <github@mintwerk.de>2017-07-03 15:04:26 (GMT)
commit19d4e8ae2e472dd364ffeff1e096d3f75d5251c4 (patch)
treef006846b1f4bf207d0c8229b52d4948bb1497b63 /src/uscxml/plugins/Factory.cpp
parentfbda090a39ad02c937345bee204ca3f77106b2bf (diff)
downloaduscxml-19d4e8ae2e472dd364ffeff1e096d3f75d5251c4.zip
uscxml-19d4e8ae2e472dd364ffeff1e096d3f75d5251c4.tar.gz
uscxml-19d4e8ae2e472dd364ffeff1e096d3f75d5251c4.tar.bz2
BEnchmarks and performance improvements
Diffstat (limited to 'src/uscxml/plugins/Factory.cpp')
-rw-r--r--src/uscxml/plugins/Factory.cpp44
1 files changed, 43 insertions, 1 deletions
diff --git a/src/uscxml/plugins/Factory.cpp b/src/uscxml/plugins/Factory.cpp
index 4c67d1f..410ac36 100644
--- a/src/uscxml/plugins/Factory.cpp
+++ b/src/uscxml/plugins/Factory.cpp
@@ -33,6 +33,11 @@
#include "uscxml/plugins/InvokerImpl.h"
#include "uscxml/plugins/DataModelImpl.h"
+#ifndef FEATS_ON_CMD
+#include "uscxml/interpreter/LargeMicroStep.h"
+#include "uscxml/interpreter/FastMicroStep.h"
+#endif
+
#if 0
#include <xercesc/dom/DOM.hpp>
#include <xercesc/util/PlatformUtils.hpp>
@@ -127,6 +132,11 @@ Factory::~Factory() {
void Factory::registerPlugins() {
+#ifndef FEATS_ON_CMD
+ registerMicrostepper(new LargeMicroStep());
+ registerMicrostepper(new FastMicroStep());
+#endif
+
/*** PLUGINS ***/
#ifdef BUILD_AS_PLUGINS
@@ -435,7 +445,6 @@ std::shared_ptr<DataModelImpl> Factory::createDataModel(const std::string& type,
return std::shared_ptr<DataModelImpl>();
}
-
bool Factory::hasIOProcessor(const std::string& type) {
if (_ioProcessorAliases.find(type) != _ioProcessorAliases.end()) {
return true;
@@ -495,6 +504,39 @@ std::shared_ptr<ExecutableContentImpl> Factory::createExecutableContent(const st
}
+#ifndef FEATS_ON_CMD
+
+bool Factory::hasMicroStepper(const std::string& name) {
+ if (_microSteppers.find(name) != _microSteppers.end()) {
+ return true;
+ } else if(_parentFactory) {
+ return _parentFactory->hasMicroStepper(name);
+ }
+ return false;
+}
+
+
+void Factory::registerMicrostepper(MicroStepImpl* microStepper) {
+ _microSteppers[microStepper->getName()] = microStepper;
+}
+
+std::shared_ptr<MicroStepImpl> Factory::createMicroStepper(const std::string& name, MicroStepCallbacks* callbacks) {
+ if (_microSteppers.find(name) != _microSteppers.end()) {
+ std::shared_ptr<MicroStepImpl> microStepper = _microSteppers[name]->create(callbacks);
+ return microStepper;
+ }
+
+ if (_parentFactory) {
+ return _parentFactory->createMicroStepper(name, callbacks);
+ } else {
+ ERROR_EXECUTION_THROW("No Microstepper '" + name + "' known");
+ }
+
+ return std::shared_ptr<MicroStepImpl>();
+
+}
+#endif
+
void DataModelImpl::addExtension(DataModelExtension* ext) {
ERROR_EXECUTION_THROW("DataModel does not support extensions");
}