diff options
author | Stefan Radomski <github@mintwerk.de> | 2016-05-12 13:12:33 (GMT) |
---|---|---|
committer | Stefan Radomski <github@mintwerk.de> | 2016-05-12 13:12:33 (GMT) |
commit | b62e7979600feee23dc7cdb61042a8fc7673122b (patch) | |
tree | f7351372f37979dd2d048e0b68a16a4cd3b2aadb /src/uscxml/plugins/IOProcessor.h | |
parent | 1b11b310be61e51b3ac5ebb83f7c8a33aef3d6e8 (diff) | |
download | uscxml-b62e7979600feee23dc7cdb61042a8fc7673122b.zip uscxml-b62e7979600feee23dc7cdb61042a8fc7673122b.tar.gz uscxml-b62e7979600feee23dc7cdb61042a8fc7673122b.tar.bz2 |
Major Refactoring v2.0
Diffstat (limited to 'src/uscxml/plugins/IOProcessor.h')
-rw-r--r-- | src/uscxml/plugins/IOProcessor.h | 39 |
1 files changed, 16 insertions, 23 deletions
diff --git a/src/uscxml/plugins/IOProcessor.h b/src/uscxml/plugins/IOProcessor.h index c770719..c7d90e5 100644 --- a/src/uscxml/plugins/IOProcessor.h +++ b/src/uscxml/plugins/IOProcessor.h @@ -22,6 +22,7 @@ #include "uscxml/Common.h" #include "uscxml/plugins/EventHandler.h" +#include "uscxml/messages/Event.h" namespace uscxml { @@ -29,38 +30,30 @@ class InterpreterImpl; class USCXML_API IOProcessorImpl : public EventHandlerImpl { public: - IOProcessorImpl() {}; - virtual ~IOProcessorImpl() {}; - virtual boost::shared_ptr<IOProcessorImpl> create(InterpreterImpl* interpreter) = 0; + + virtual std::shared_ptr<IOProcessorImpl> create(InterpreterImpl* interpreter) = 0; + virtual void eventFromSCXML(const std::string& target, const Event& event) = 0; + virtual bool isValidTarget(const std::string& target) = 0; + +protected: + void eventToSCXML(Event& event, const std::string& type, const std::string& origin, bool internal = false); + }; class USCXML_API IOProcessor : public EventHandler { public: - IOProcessor() : _impl() {} - IOProcessor(boost::shared_ptr<IOProcessorImpl> const impl) : EventHandler(impl), _impl(impl) { } - IOProcessor(const IOProcessor& other) : EventHandler(other._impl), _impl(other._impl) { } - virtual ~IOProcessor() {}; + PIMPL_OPERATORS2(IOProcessor, EventHandler) - operator bool() const { - return !!_impl; + virtual void eventFromSCXML(const std::string& target, const Event& event) { + _impl->eventFromSCXML(target, event); } - bool operator< (const IOProcessor& other) const { - return _impl < other._impl; - } - bool operator==(const IOProcessor& other) const { - return _impl == other._impl; - } - bool operator!=(const IOProcessor& other) const { - return _impl != other._impl; - } - IOProcessor& operator= (const IOProcessor& other) { - _impl = other._impl; - EventHandler::_impl = _impl; - return *this; + + virtual bool isValidTarget(const std::string& target) { + return _impl->isValidTarget(target); } protected: - boost::shared_ptr<IOProcessorImpl> _impl; + std::shared_ptr<IOProcessorImpl> _impl; friend class InterpreterImpl; }; |