X-Git-Url: http://g0dil.de/git?a=blobdiff_plain;f=Scheduler%2FFdEvent.ih;h=039ee76b3a8b0ce56215ef4d53d30ac64ca13123;hb=87204d50de0c429f265aec817bc9efd9af816082;hp=15d106c7c7978e866533968ab208a65c6ba9d987;hpb=03516e8371a90f908ce54dedb3c874eec7dd08ff;p=senf.git diff --git a/Scheduler/FdEvent.ih b/Scheduler/FdEvent.ih index 15d106c..039ee76 100644 --- a/Scheduler/FdEvent.ih +++ b/Scheduler/FdEvent.ih @@ -23,40 +23,40 @@ /** \file \brief FdDispatcher internal header */ -#ifndef IH_FdDispatcher_ -#define IH_FdDispatcher_ 1 +#ifndef IH_SENF_Scheduler_FdEvent_ +#define IH_SENF_Scheduler_FdEvent_ 1 // Custom includes -#include "../boost/intrusive/iset.hpp" +#include ///////////////////////////////ih.p//////////////////////////////////////// namespace senf { +namespace scheduler { - class Scheduler; + void restart(); -namespace scheduler { namespace detail { struct FdSetCompare { - bool operator()(FdEvent const & a, FdEvent const & b) const - { return a.fd_ < b.fd_; } + bool operator()(FdEvent const & a, FdEvent const & b) const + { return a.fd_ < b.fd_; } }; struct FindFd { - bool operator()(FdEvent const & a, int b) const - { return a.fd_ < b; } - bool operator()(int a, FdEvent const & b) const - { return a < b.fd_; } + bool operator()(FdEvent const & a, int b) const + { return a.fd_ < b; } + bool operator()(int a, FdEvent const & b) const + { return a < b.fd_; } }; class FdDispatcher - : public senf::singleton + : public senf::singleton { public: - using senf::singleton::instance; - using senf::singleton::alive; - + using senf::singleton::instance; + using senf::singleton::alive; + bool add(FdEvent & event); void remove(FdEvent & event); @@ -68,29 +68,30 @@ namespace detail { FdDispatcher(); ~FdDispatcher(); - typedef boost::intrusive::imultiset< FdSetBase::value_traits, - FdSetCompare, - false > FdSet; + typedef boost::intrusive::imultiset< FdSetBase::value_traits, + FdSetCompare, + false > FdSet; FdSet fds_; - friend class senf::Scheduler; + friend void senf::scheduler::restart(); friend class singleton; friend class senf::scheduler::FdEvent; }; class FileDispatcher - : public senf::singleton + : public senf::singleton { public: - using senf::singleton::instance; - using senf::singleton::alive; + using senf::singleton::instance; + using senf::singleton::alive; void add(FdEvent & event); void remove(FdEvent & event); void prepareRun(); + // Called by IdleEventDispatcher void timeout(int t); int timeout() const; @@ -104,17 +105,22 @@ namespace detail { // We really only need a list here but we need to use the same event structure used by // the FdEvent. - typedef boost::intrusive::imultiset< FdSetBase::value_traits, - FdSetCompare, - false > FdSet; + typedef boost::intrusive::imultiset< FdSetBase::value_traits, + FdSetCompare, + false > FdSet; FdSet fds_; int managerTimeout_; - friend class senf::Scheduler; + friend void senf::scheduler::restart(); friend class singleton; }; + template + int get_descriptor(Handle const & handle); + + int retrieve_filehandle(int fd); + }}} ///////////////////////////////ih.e////////////////////////////////////////