diff options
author | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2014-08-21 15:14:55 (GMT) |
---|---|---|
committer | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2014-08-21 15:14:55 (GMT) |
commit | f7ad82f972bf46571bb5229205f877f8ab31069d (patch) | |
tree | e83110054a551053a68fb93d7061709808a19a0d /src/uscxml/Factory.cpp | |
parent | a3fb1daf5b4e58471cc714853636025b6cac9aed (diff) | |
download | uscxml-f7ad82f972bf46571bb5229205f877f8ab31069d.zip uscxml-f7ad82f972bf46571bb5229205f877f8ab31069d.tar.gz uscxml-f7ad82f972bf46571bb5229205f877f8ab31069d.tar.bz2 |
New Interpreter::validate() to identify issues with a document before running it
Diffstat (limited to 'src/uscxml/Factory.cpp')
-rw-r--r-- | src/uscxml/Factory.cpp | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/src/uscxml/Factory.cpp b/src/uscxml/Factory.cpp index 9ebc0d8..7117de2 100644 --- a/src/uscxml/Factory.cpp +++ b/src/uscxml/Factory.cpp @@ -528,6 +528,15 @@ std::map<std::string, IOProcessorImpl*> Factory::getIOProcessors() { return ioProcs; } +bool Factory::hasInvoker(const std::string& type) { + if (_invokerAliases.find(type) != _invokerAliases.end()) { + return true; + } else if(_parentFactory) { + return _parentFactory->hasInvoker(type); + } + return false; +} + boost::shared_ptr<InvokerImpl> Factory::createInvoker(const std::string& type, InterpreterImpl* interpreter) { // do we have this type ourself? @@ -550,6 +559,16 @@ boost::shared_ptr<InvokerImpl> Factory::createInvoker(const std::string& type, I return boost::shared_ptr<InvokerImpl>(); } + +bool Factory::hasDataModel(const std::string& type) { + if (_dataModelAliases.find(type) != _dataModelAliases.end()) { + return true; + } else if(_parentFactory) { + return _parentFactory->hasDataModel(type); + } + return false; +} + boost::shared_ptr<DataModelImpl> Factory::createDataModel(const std::string& type, InterpreterImpl* interpreter) { // do we have this type ourself? @@ -572,6 +591,16 @@ boost::shared_ptr<DataModelImpl> Factory::createDataModel(const std::string& typ return boost::shared_ptr<DataModelImpl>(); } + +bool Factory::hasIOProcessor(const std::string& type) { + if (_ioProcessorAliases.find(type) != _ioProcessorAliases.end()) { + return true; + } else if(_parentFactory) { + return _parentFactory->hasIOProcessor(type); + } + return false; +} + boost::shared_ptr<IOProcessorImpl> Factory::createIOProcessor(const std::string& type, InterpreterImpl* interpreter) { // do we have this type ourself? if (_ioProcessorAliases.find(type) != _ioProcessorAliases.end()) { @@ -593,6 +622,16 @@ boost::shared_ptr<IOProcessorImpl> Factory::createIOProcessor(const std::string& return boost::shared_ptr<IOProcessorImpl>(); } +bool Factory::hasExecutableContent(const std::string& localName, const std::string& nameSpace) { + std::string actualNameSpace = (nameSpace.length() == 0 ? "http://www.w3.org/2005/07/scxml" : nameSpace); + if (_executableContent.find(std::make_pair(localName, actualNameSpace)) != _executableContent.end()) { + return true; + } else if(_parentFactory) { + return _parentFactory->hasExecutableContent(localName, nameSpace); + } + return false; +} + boost::shared_ptr<ExecutableContentImpl> Factory::createExecutableContent(const std::string& localName, const std::string& nameSpace, InterpreterImpl* interpreter) { // do we have this type in this factory? std::string actualNameSpace = (nameSpace.length() == 0 ? "http://www.w3.org/2005/07/scxml" : nameSpace); |