template <class Handle>
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)
{}
///////////////////////////////////////////////////////////////////////////
-prefix_ int retrieve_filehandle(int fd)
+prefix_ int senf::scheduler::detail::retrieve_filehandle(int fd)
{
return fd;
}
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();
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 <class Handle>
+prefix_ int senf::scheduler::get_descriptor(Handle const & handle)
+{
+ return detail::get_descriptor(handle);
+}
+
+template <class Handle>
+prefix_ int senf::scheduler::detail::get_descriptor(Handle const & handle)
+{
+ return retrieve_filehandle(handle);
+}
+
///////////////////////////////cti.e///////////////////////////////////////
#undef prefix_
friend class detail::FileDispatcher;
};
+ template <class Handle>
+ int get_descriptor(Handle const & handle);
}}
-int retrieve_filehandle(int fd);
-
///////////////////////////////hh.e////////////////////////////////////////
#include "FdEvent.cci"
#include "FdEvent.ct"
friend class singleton<FileDispatcher>;
};
+ template <class Handle>
+ int get_descriptor(Handle const & handle);
+
+ int retrieve_filehandle(int fd);
+
}}}
///////////////////////////////ih.e////////////////////////////////////////