diff options
author | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2013-02-20 21:13:02 (GMT) |
---|---|---|
committer | Stefan Radomski <radomski@tk.informatik.tu-darmstadt.de> | 2013-02-20 21:13:02 (GMT) |
commit | a56f28b0db56ff3e39f0b50e4c55c52b7aeec696 (patch) | |
tree | 41cf67ea5cee9593e86272ab55367653fbd1c2f3 /src/uscxml/Factory.h | |
parent | 7c779099b3acd1fa969dde718299484ebe0d2775 (diff) | |
download | uscxml-a56f28b0db56ff3e39f0b50e4c55c52b7aeec696.zip uscxml-a56f28b0db56ff3e39f0b50e4c55c52b7aeec696.tar.gz uscxml-a56f28b0db56ff3e39f0b50e4c55c52b7aeec696.tar.bz2 |
See detailled log
- Builds on windows again
- All HTTP requests are no passed into interpreter
- New response element to reply with data
- Moved basichttp URL
- New HTTP servlet invoker to register additional URLs
- More bugfixes than I care to mention
Diffstat (limited to 'src/uscxml/Factory.h')
-rw-r--r-- | src/uscxml/Factory.h | 63 |
1 files changed, 58 insertions, 5 deletions
diff --git a/src/uscxml/Factory.h b/src/uscxml/Factory.h index 8004366..9397e36 100644 --- a/src/uscxml/Factory.h +++ b/src/uscxml/Factory.h @@ -35,13 +35,63 @@ inline bool isNumeric( const char* pszInput, int nNumberBase) { class Interpreter; -#if 0 -class ExecutableContent { +class ExecutableContentImpl { public: - ExecutableContent() {}; - virtual boost::shared_ptr<ExecutableContentImpl>* create(Interpreter* interpreter) = 0; + ExecutableContentImpl() {}; + virtual ~ExecutableContentImpl() {}; + virtual boost::shared_ptr<ExecutableContentImpl> create(Interpreter* interpreter) = 0; + + virtual void setInterpreter(Interpreter* interpreter) { + _interpreter = interpreter; + } + + virtual std::string getLocalName() = 0; ///< The name of the element. + virtual std::string getNamespace() = 0; ///< The namespace of the element. + virtual void enterElement(const Arabica::DOM::Node<std::string>& node) = 0; ///< Invoked when entering the element as part of evaluating executable content. + virtual void exitElement(const Arabica::DOM::Node<std::string>& node) = 0; ///< Invoked when exiting the element as part of evaluating executable content. + virtual bool processChildren() = 0; ///< Whether or not the interpreter should process this elements children. + +protected: + Interpreter* _interpreter; }; -#endif + +class ExecutableContent { +public: + ExecutableContent() : _impl() {} + ExecutableContent(boost::shared_ptr<ExecutableContentImpl> const impl) : _impl(impl) { } + ExecutableContent(const ExecutableContent& other) : _impl(other._impl) { } + virtual ~ExecutableContent() {}; + + operator bool() const { + return _impl; + } + bool operator< (const ExecutableContent& other) const { + return _impl < other._impl; + } + bool operator==(const ExecutableContent& other) const { + return _impl == other._impl; + } + bool operator!=(const ExecutableContent& other) const { + return _impl != other._impl; + } + ExecutableContent& operator= (const ExecutableContent& other) { + _impl = other._impl; + return *this; + } + + void setInterpreter(Interpreter* interpreter) { + _impl->setInterpreter(interpreter); + } + + std::string getLocalName() { return _impl->getLocalName(); } + std::string getNamespace() { return _impl->getNamespace(); } + void enterElement(const Arabica::DOM::Node<std::string>& node) { return _impl->enterElement(node); } + void exitElement(const Arabica::DOM::Node<std::string>& node) { return _impl->exitElement(node); } + bool processChildren() { return _impl->processChildren(); } +protected: + boost::shared_ptr<ExecutableContentImpl> _impl; + + }; class IOProcessorImpl { public: @@ -264,10 +314,12 @@ public: void registerIOProcessor(IOProcessorImpl* ioProcessor); void registerDataModel(DataModelImpl* dataModel); void registerInvoker(InvokerImpl* invoker); + void registerExecutableContent(ExecutableContentImpl* executableContent); static boost::shared_ptr<DataModelImpl> createDataModel(const std::string& type, Interpreter* interpreter); static boost::shared_ptr<IOProcessorImpl> createIOProcessor(const std::string& type, Interpreter* interpreter); static boost::shared_ptr<InvokerImpl> createInvoker(const std::string& type, Interpreter* interpreter); + static boost::shared_ptr<ExecutableContentImpl> createExecutableContent(const std::string& localName, const std::string& nameSpace, Interpreter* interpreter); static Factory* getInstance(); @@ -277,6 +329,7 @@ public: std::map<std::string, std::string> _ioProcessorAliases; std::map<std::string, InvokerImpl*> _invokers; std::map<std::string, std::string> _invokerAliases; + std::map<std::pair<std::string, std::string>, ExecutableContentImpl*> _executableContent; static std::string pluginPath; |