diff options
author | Martin Sustrik <sustrik@250bpm.com> | 2011-06-27 18:16:53 +0200 |
---|---|---|
committer | Martin Sustrik <sustrik@250bpm.com> | 2011-06-27 18:16:53 +0200 |
commit | f8bf3a4cef6b8e1688683ab8c5ed6dd1bc8e3a12 (patch) | |
tree | c73fa27cb241d8b4639b0cc535fbd3c6f39c3821 /src/i_engine.hpp | |
parent | 3ae73ee11f13bbc9c91b235de18fde763c359009 (diff) |
Rename i_inout to i_engine_sink
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Diffstat (limited to 'src/i_engine.hpp')
-rw-r--r-- | src/i_engine.hpp | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/src/i_engine.hpp b/src/i_engine.hpp index 7bd4ea6..636985f 100644 --- a/src/i_engine.hpp +++ b/src/i_engine.hpp @@ -24,13 +24,15 @@ namespace zmq { + // Abstract interface to be implemented by various engines. + struct i_engine { virtual ~i_engine () {} // Plug the engine to the session. virtual void plug (class io_thread_t *io_thread_, - struct i_inout *inout_) = 0; + struct i_engine_sink *sink_) = 0; // Unplug the engine from the session. virtual void unplug () = 0; @@ -48,6 +50,25 @@ namespace zmq virtual void activate_out () = 0; }; + // Abstract interface to be implemented by engine sinks such as sessions. + + struct i_engine_sink + { + virtual ~i_engine_sink () {} + + // Engine asks for a message to send to the network. + virtual bool read (class msg_t *msg_) = 0; + + // Engine received message from the network and sends it further on. + virtual bool write (class msg_t *msg_) = 0; + + // Flush all the previously written messages. + virtual void flush () = 0; + + // Engine is dead. Drop all the references to it. + virtual void detach () = 0; + }; + } #endif |