From 71744dc8ef9b59a342b03f7ba2c3699f5ccb862a Mon Sep 17 00:00:00 2001 From: Martin Sustrik Date: Thu, 16 Feb 2012 10:04:47 +0900 Subject: i_poll_events interface moved to poller_base.hpp Signed-off-by: Martin Sustrik --- src/Makefile.am | 1 - src/devpoll.cpp | 1 - src/epoll.cpp | 1 - src/i_poll_events.hpp | 49 ------------------------------------------------- src/io_object.hpp | 1 - src/io_thread.hpp | 1 - src/kqueue.cpp | 1 - src/poll.cpp | 1 - src/poller_base.cpp | 1 - src/poller_base.hpp | 20 ++++++++++++++++++-- src/reaper.hpp | 1 - src/select.cpp | 1 - src/socket_base.hpp | 1 - 13 files changed, 18 insertions(+), 62 deletions(-) delete mode 100644 src/i_poll_events.hpp (limited to 'src') diff --git a/src/Makefile.am b/src/Makefile.am index 2c5341f..09d8a31 100644 --- a/src/Makefile.am +++ b/src/Makefile.am @@ -29,7 +29,6 @@ libxs_la_SOURCES = \ ipc_connecter.hpp \ ipc_listener.hpp \ i_engine.hpp \ - i_poll_events.hpp \ kqueue.hpp \ lb.hpp \ likely.hpp \ diff --git a/src/devpoll.cpp b/src/devpoll.cpp index e6c8007..4cf4d6a 100644 --- a/src/devpoll.cpp +++ b/src/devpoll.cpp @@ -36,7 +36,6 @@ #include "devpoll.hpp" #include "err.hpp" #include "config.hpp" -#include "i_poll_events.hpp" xs::devpoll_t::devpoll_t () : stopping (false) diff --git a/src/epoll.cpp b/src/epoll.cpp index 37e47d3..0ab5d19 100644 --- a/src/epoll.cpp +++ b/src/epoll.cpp @@ -33,7 +33,6 @@ #include "epoll.hpp" #include "err.hpp" #include "config.hpp" -#include "i_poll_events.hpp" xs::epoll_t::epoll_t () : stopping (false) diff --git a/src/i_poll_events.hpp b/src/i_poll_events.hpp deleted file mode 100644 index 0b9bd86..0000000 --- a/src/i_poll_events.hpp +++ /dev/null @@ -1,49 +0,0 @@ -/* - Copyright (c) 2010-2012 250bpm s.r.o. - Copyright (c) 2007-2009 iMatix Corporation - Copyright (c) 2007-2011 Other contributors as noted in the AUTHORS file - - This file is part of Crossroads project. - - Crossroads is free software; you can redistribute it and/or modify it under - the terms of the GNU Lesser General Public License as published by - the Free Software Foundation; either version 3 of the License, or - (at your option) any later version. - - Crossroads is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - GNU Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public License - along with this program. If not, see . -*/ - -#ifndef __XS_I_POLL_EVENTS_HPP_INCLUDED__ -#define __XS_I_POLL_EVENTS_HPP_INCLUDED__ - -#include "fd.hpp" - -namespace xs -{ - - // 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; - }; - -} - -#endif diff --git a/src/io_object.hpp b/src/io_object.hpp index 4bce10c..61f7523 100644 --- a/src/io_object.hpp +++ b/src/io_object.hpp @@ -26,7 +26,6 @@ #include "stdint.hpp" #include "poller_base.hpp" -#include "i_poll_events.hpp" namespace xs { diff --git a/src/io_thread.hpp b/src/io_thread.hpp index 744eec5..e05ba05 100644 --- a/src/io_thread.hpp +++ b/src/io_thread.hpp @@ -27,7 +27,6 @@ #include "stdint.hpp" #include "object.hpp" #include "poller_base.hpp" -#include "i_poll_events.hpp" #include "mailbox.hpp" namespace xs diff --git a/src/kqueue.cpp b/src/kqueue.cpp index 495a194..154e498 100644 --- a/src/kqueue.cpp +++ b/src/kqueue.cpp @@ -34,7 +34,6 @@ #include "kqueue.hpp" #include "err.hpp" #include "config.hpp" -#include "i_poll_events.hpp" #include "likely.hpp" // NetBSD defines (struct kevent).udata as intptr_t, everyone else diff --git a/src/poll.cpp b/src/poll.cpp index 2677bb0..ab17ccd 100644 --- a/src/poll.cpp +++ b/src/poll.cpp @@ -31,7 +31,6 @@ #include "poll.hpp" #include "err.hpp" #include "config.hpp" -#include "i_poll_events.hpp" xs::poll_t::poll_t () : retired (false), diff --git a/src/poller_base.cpp b/src/poller_base.cpp index 5fe3a4f..39ae654 100644 --- a/src/poller_base.cpp +++ b/src/poller_base.cpp @@ -19,7 +19,6 @@ */ #include "poller_base.hpp" -#include "i_poll_events.hpp" #include "err.hpp" #include "select.hpp" 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: diff --git a/src/reaper.hpp b/src/reaper.hpp index 805916f..c76970e 100644 --- a/src/reaper.hpp +++ b/src/reaper.hpp @@ -24,7 +24,6 @@ #include "object.hpp" #include "mailbox.hpp" #include "poller_base.hpp" -#include "i_poll_events.hpp" namespace xs { diff --git a/src/select.cpp b/src/select.cpp index 49b4e74..65772c7 100644 --- a/src/select.cpp +++ b/src/select.cpp @@ -42,7 +42,6 @@ #include "err.hpp" #include "config.hpp" -#include "i_poll_events.hpp" xs::select_t::select_t () : maxfd (retired_fd), diff --git a/src/socket_base.hpp b/src/socket_base.hpp index 250215b..6aafeb2 100644 --- a/src/socket_base.hpp +++ b/src/socket_base.hpp @@ -30,7 +30,6 @@ #include "stdint.hpp" #include "poller_base.hpp" #include "atomic_counter.hpp" -#include "i_poll_events.hpp" #include "mailbox.hpp" #include "stdint.hpp" #include "pipe.hpp" -- cgit v1.2.3