diff options
Diffstat (limited to 'src/uscxml/plugins/Invoker.h')
-rw-r--r-- | src/uscxml/plugins/Invoker.h | 67 |
1 files changed, 23 insertions, 44 deletions
diff --git a/src/uscxml/plugins/Invoker.h b/src/uscxml/plugins/Invoker.h index c22b7e3..33a89d6 100644 --- a/src/uscxml/plugins/Invoker.h +++ b/src/uscxml/plugins/Invoker.h @@ -21,63 +21,42 @@ #define INVOKER_H_CAC11892 +#include "uscxml/config.h" #include "uscxml/Common.h" #include "uscxml/plugins/EventHandler.h" #include "uscxml/messages/Event.h" +#include <xercesc/dom/DOM.hpp> -namespace uscxml { - -class Interpreter; - -class USCXML_API InvokerImpl : public EventHandlerImpl { -public: - InvokerImpl() : _finalize(NULL) {}; - virtual ~InvokerImpl() {} - virtual std::list<std::string> getNames() = 0; - - virtual void invoke(const std::string& source, const Event& invokeEvent) = 0; - virtual void uninvoke() = 0; - - virtual void eventFromSCXML(const Event& event) = 0; - - virtual std::shared_ptr<InvokerImpl> create(InterpreterImpl* interpreter) = 0; - virtual xercesc::DOMElement* getFinalize() { - return _finalize; - } - virtual void setFinalize(xercesc::DOMElement* finalize) { - _finalize = finalize; - } - virtual void setInvokeId(const std::string& invokeId) { - _invokeId = invokeId; - } - -protected: - void eventToSCXML(Event& event, const std::string& type, const std::string& invokeId, bool internal = false); +namespace XERCESC_NS { + class DOMDocument; + class DOMNode; +} - xercesc::DOMElement* _finalize; - std::string _invokeId; +namespace uscxml { -}; +class InvokerImpl; +/** + * @ingroup invoker + * @ingroup facade + * Facade for invoker implementation. + */ class USCXML_API Invoker : public EventHandler { public: - PIMPL_OPERATORS2(Invoker, EventHandler); + PIMPL_OPERATORS_INHERIT(Invoker, EventHandler); + + /// @copydoc InvokerImpl::invoke + virtual void invoke(const std::string& source, const Event& invokeEvent); - virtual void invoke(const std::string& source, const Event& invokeEvent) { - _impl->invoke(source, invokeEvent); - } + /// @copydoc InvokerImpl::uninvoke + virtual void uninvoke(); - virtual void uninvoke() { - _impl->uninvoke(); - } + /// @copydoc InvokerImpl::eventFromSCXML + virtual void eventFromSCXML(const Event& event); - virtual void eventFromSCXML(const Event& event) { - _impl->eventFromSCXML(event); - } + /// @copydoc InvokerImpl::getFinalize + virtual XERCESC_NS::DOMElement* getFinalize(); - virtual xercesc::DOMElement* getFinalize() { - return _impl->getFinalize(); - } protected: std::shared_ptr<InvokerImpl> _impl; }; |