diff options
Diffstat (limited to 'src/uscxml/plugins/Factory.cpp')
-rw-r--r-- | src/uscxml/plugins/Factory.cpp | 44 |
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"); } |