diff options
Diffstat (limited to 'src/uscxml/plugins')
-rw-r--r-- | src/uscxml/plugins/Factory.cpp | 48 | ||||
-rw-r--r-- | src/uscxml/plugins/Factory.h | 32 |
2 files changed, 40 insertions, 40 deletions
diff --git a/src/uscxml/plugins/Factory.cpp b/src/uscxml/plugins/Factory.cpp index 410ac36..9e885e5 100644 --- a/src/uscxml/plugins/Factory.cpp +++ b/src/uscxml/plugins/Factory.cpp @@ -133,10 +133,10 @@ Factory::~Factory() { void Factory::registerPlugins() { #ifndef FEATS_ON_CMD - registerMicrostepper(new LargeMicroStep()); - registerMicrostepper(new FastMicroStep()); + registerMicrostepper(new LargeMicroStep()); + registerMicrostepper(new FastMicroStep()); #endif - + /*** PLUGINS ***/ #ifdef BUILD_AS_PLUGINS @@ -507,36 +507,36 @@ 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; + 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; + _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>(); + 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"); } diff --git a/src/uscxml/plugins/Factory.h b/src/uscxml/plugins/Factory.h index 986ff5f..cd7a5c7 100644 --- a/src/uscxml/plugins/Factory.h +++ b/src/uscxml/plugins/Factory.h @@ -53,31 +53,31 @@ public: Factory(const std::string& pluginPath, Factory* parentFactory); void registerIOProcessor(IOProcessorImpl* ioProcessor); - bool hasIOProcessor(const std::string& type); - std::shared_ptr<IOProcessorImpl> createIOProcessor(const std::string& type, IOProcessorCallbacks* callbacks); + bool hasIOProcessor(const std::string& type); + std::shared_ptr<IOProcessorImpl> createIOProcessor(const std::string& type, IOProcessorCallbacks* callbacks); - void registerDataModel(DataModelImpl* dataModel); - bool hasDataModel(const std::string& type); - std::shared_ptr<DataModelImpl> createDataModel(const std::string& type, DataModelCallbacks* callbacks); + void registerDataModel(DataModelImpl* dataModel); + bool hasDataModel(const std::string& type); + std::shared_ptr<DataModelImpl> createDataModel(const std::string& type, DataModelCallbacks* callbacks); - void registerInvoker(InvokerImpl* invoker); - bool hasInvoker(const std::string& type); - std::shared_ptr<InvokerImpl> createInvoker(const std::string& type, InvokerCallbacks* interpreter); + void registerInvoker(InvokerImpl* invoker); + bool hasInvoker(const std::string& type); + std::shared_ptr<InvokerImpl> createInvoker(const std::string& type, InvokerCallbacks* interpreter); - void registerExecutableContent(ExecutableContentImpl* executableContent); - bool hasExecutableContent(const std::string& localName, const std::string& nameSpace); - std::shared_ptr<ExecutableContentImpl> createExecutableContent(const std::string& localName, const std::string& nameSpace, InterpreterImpl* interpreter); + void registerExecutableContent(ExecutableContentImpl* executableContent); + bool hasExecutableContent(const std::string& localName, const std::string& nameSpace); + std::shared_ptr<ExecutableContentImpl> createExecutableContent(const std::string& localName, const std::string& nameSpace, InterpreterImpl* interpreter); #ifndef FEATS_ON_CMD - void registerMicrostepper(MicroStepImpl* microStepper); - bool hasMicroStepper(const std::string& name); - std::shared_ptr<MicroStepImpl> createMicroStepper(const std::string& name, MicroStepCallbacks* callbacks); + void registerMicrostepper(MicroStepImpl* microStepper); + bool hasMicroStepper(const std::string& name); + std::shared_ptr<MicroStepImpl> createMicroStepper(const std::string& name, MicroStepCallbacks* callbacks); #endif - std::map<std::string, IOProcessorImpl*> getIOProcessors(); + std::map<std::string, IOProcessorImpl*> getIOProcessors(); void listComponents(); @@ -96,7 +96,7 @@ protected: std::map<std::pair<std::string, std::string>, ExecutableContentImpl*> _executableContent; #ifndef FEATS_ON_CMD - std::map<std::string, MicroStepImpl*> _microSteppers; + std::map<std::string, MicroStepImpl*> _microSteppers; #endif #ifdef BUILD_AS_PLUGINS |