summaryrefslogtreecommitdiff
path: root/src/poller_base.hpp
diff options
context:
space:
mode:
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: