summaryrefslogtreecommitdiff
path: root/src/poller_base.hpp
diff options
context:
space:
mode:
authorMartin Sustrik <sustrik@250bpm.com>2012-02-16 10:04:47 +0900
committerMartin Sustrik <sustrik@250bpm.com>2012-02-16 10:04:47 +0900
commit71744dc8ef9b59a342b03f7ba2c3699f5ccb862a (patch)
tree560edfdfca45c41d12c728c4afa82d0056d09378 /src/poller_base.hpp
parent7e4fa8505f479c494b9e7bab361e4a11e1c579a5 (diff)
i_poll_events interface moved to poller_base.hpp
Signed-off-by: Martin Sustrik <sustrik@250bpm.com>
Diffstat (limited to 'src/poller_base.hpp')
-rw-r--r--src/poller_base.hpp20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/poller_base.hpp b/src/poller_base.hpp
index 8d9ed16..4822e0e 100644
--- a/src/poller_base.hpp
+++ b/src/poller_base.hpp
@@ -30,10 +30,26 @@
namespace xs
{
- struct i_poll_events;
-
+ // Handle of a file descriptor within a pollset.
typedef void* handle_t;
+ // Virtual interface to be exposed by object that want to be notified
+ // about events on file descriptors.
+
+ struct i_poll_events
+ {
+ virtual ~i_poll_events () {}
+
+ // Called by I/O thread when file descriptor is ready for reading.
+ virtual void in_event (fd_t fd_) = 0;
+
+ // Called by I/O thread when file descriptor is ready for writing.
+ virtual void out_event (fd_t fd_) = 0;
+
+ // Called when timer expires.
+ virtual void timer_event (int id_) = 0;
+ };
+
class poller_base_t
{
public: