X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Scheduler%2FPoller.hh;h=68f96fe4a0bd65e4995fcc16ae8d2639e192d49d;hb=cc2bf0a1a29245d102d1962118fb19ef178393cf;hp=0dc5504aa4c95fdf6ab955756b24bfc91efa30a4;hpb=919e588a2c387c9a910aa8761e65155a0d205bba;p=senf.git diff --git a/Scheduler/Poller.hh b/Scheduler/Poller.hh index 0dc5504..68f96fe 100644 --- a/Scheduler/Poller.hh +++ b/Scheduler/Poller.hh @@ -37,8 +37,15 @@ namespace senf { namespace scheduler { +namespace detail { - /** \brief + /** \brief Epoll abstraction + + This class provides a more convenient interface to the epoll() API. File descriptors are + registered with pointers to a parameterized event type. After waiting for an event, the + Poller allows to iterate over the event instances for all posted events. + + \tparam Value Event type */ template class Poller @@ -63,8 +70,8 @@ namespace scheduler { enum Events { EV_READ = EPOLLIN, EV_PRIO = EPOLLPRI, EV_WRITE = EPOLLOUT, EV_HUP = EPOLLHUP, EV_ERR = EPOLLERR -}; - + }; + /////////////////////////////////////////////////////////////////////////// ///\name Structors and default members ///@{ @@ -75,12 +82,17 @@ namespace scheduler { ///@} /////////////////////////////////////////////////////////////////////////// - bool set(int fd, int events, Value * data); - void remove(int fd); - range wait(); + bool set(int fd, int events, Value * data); ///< Set file descriptor event data and mask + /**< The Poller does \e not own \a data. The value is owned + by some external entity (the dispatcher to be more + precise). */ + void remove(int fd); ///< Remove file descriptor + range wait(); ///< Wait for one event + /**< \returns a range of iterators which iterate over the + data values registered with the event */ - void timeout(int t); - int timeout() const; + void timeout(int t); ///< Set event timeout to \a t milliseconds + int timeout() const; ///< Current event timeout private: int epollFd_; @@ -88,7 +100,7 @@ namespace scheduler { }; -}} +}}} ///////////////////////////////hh.e//////////////////////////////////////// //#include "Poller.cci"