From: g0dil Date: Thu, 25 Sep 2008 23:07:01 +0000 (+0000) Subject: Scheduler: Fix retrieve_filehandle ADL lookup problems X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=23ef68f7c443f0993b2b46cd912666c040fdccba;p=senf.git Scheduler: Fix retrieve_filehandle ADL lookup problems git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@919 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/PPI/IOEvent.cti b/PPI/IOEvent.cti index 29c0fbb..7372e36 100644 --- a/PPI/IOEvent.cti +++ b/PPI/IOEvent.cti @@ -36,7 +36,7 @@ template prefix_ senf::ppi::IOEvent::IOEvent(Handle handle, unsigned events) - : fd_ (retrieve_filehandle(handle)), + : fd_ (senf::scheduler::get_descriptor(handle)), event_ ("senf::ppi::IOEvent", boost::bind(&IOEvent::cb,this,_1), fd_, events, false) {} diff --git a/Scheduler/FdEvent.cci b/Scheduler/FdEvent.cci index 2231de9..93dded7 100644 --- a/Scheduler/FdEvent.cci +++ b/Scheduler/FdEvent.cci @@ -109,7 +109,7 @@ prefix_ bool senf::scheduler::detail::FileDispatcher::empty() /////////////////////////////////////////////////////////////////////////// -prefix_ int retrieve_filehandle(int fd) +prefix_ int senf::scheduler::detail::retrieve_filehandle(int fd) { return fd; } diff --git a/Scheduler/FdEvent.ct b/Scheduler/FdEvent.ct index c6dfbf9..f70a35c 100644 --- a/Scheduler/FdEvent.ct +++ b/Scheduler/FdEvent.ct @@ -37,7 +37,7 @@ template prefix_ senf::scheduler::FdEvent & senf::scheduler::FdEvent::handle(Handle const & handle) { bool en (enabled()); - fd_ = retrieve_filehandle(handle); + fd_ = detail::get_descriptor(handle); pollable_ = true; if (en) enable(); diff --git a/Scheduler/FdEvent.cti b/Scheduler/FdEvent.cti index 44b7299..317a4eb 100644 --- a/Scheduler/FdEvent.cti +++ b/Scheduler/FdEvent.cti @@ -37,13 +37,27 @@ template prefix_ senf::scheduler::FdEvent::FdEvent(std::string const & name, Callback const & cb, Handle const & handle, int events, bool initiallyEnabled) - : detail::FIFORunner::TaskInfo (name), cb_ (cb), fd_ (retrieve_filehandle(handle)), pollable_ (true), - events_ (events) + : detail::FIFORunner::TaskInfo (name), cb_ (cb), fd_ (detail::get_descriptor(handle)), + pollable_ (true), events_ (events) { if (initiallyEnabled) enable(); } +/////////////////////////////////////////////////////////////////////////// + +template +prefix_ int senf::scheduler::get_descriptor(Handle const & handle) +{ + return detail::get_descriptor(handle); +} + +template +prefix_ int senf::scheduler::detail::get_descriptor(Handle const & handle) +{ + return retrieve_filehandle(handle); +} + ///////////////////////////////cti.e/////////////////////////////////////// #undef prefix_ diff --git a/Scheduler/FdEvent.hh b/Scheduler/FdEvent.hh index 75e3f52..90ddc7a 100644 --- a/Scheduler/FdEvent.hh +++ b/Scheduler/FdEvent.hh @@ -171,10 +171,10 @@ namespace scheduler { friend class detail::FileDispatcher; }; + template + int get_descriptor(Handle const & handle); }} -int retrieve_filehandle(int fd); - ///////////////////////////////hh.e//////////////////////////////////////// #include "FdEvent.cci" #include "FdEvent.ct" diff --git a/Scheduler/FdEvent.ih b/Scheduler/FdEvent.ih index d958436..bcb98a9 100644 --- a/Scheduler/FdEvent.ih +++ b/Scheduler/FdEvent.ih @@ -115,6 +115,11 @@ namespace detail { friend class singleton; }; + template + int get_descriptor(Handle const & handle); + + int retrieve_filehandle(int fd); + }}} ///////////////////////////////ih.e////////////////////////////////////////