Socket/Protocols/INet: Implement SSM Multicast API
[senf.git] / Scheduler / FdEvent.hh
index 2a49489..78409f4 100644 (file)
@@ -91,15 +91,15 @@ namespace scheduler {
        typedef boost::function<void (int)> Callback;
 
         enum Events { 
-            EV_NONE = 0                 ///< No event
-          , EV_READ = detail::FdManager::EV_READ ///< fd readable (or EOF)
-          , EV_PRIO = detail::FdManager::EV_PRIO, ///< OOB data available for read
-          , EV_WRITE = detail::FdManager::EV_WRITE ///< fd writable
-          , EV_HUP = detail::FdManager::EV_HUP ///< remote end closed connection
-          , EV_ERR = detail::FdManager::EV_ERR ///< transport error
+            EV_NONE = 0                             ///< No event
+          , EV_READ = detail::FdManager::EV_READ    ///< fd readable (or EOF)
+          , EV_PRIO = detail::FdManager::EV_PRIO    ///< OOB data available for read
+          , EV_WRITE = detail::FdManager::EV_WRITE  ///< fd writable
+          , EV_HUP = detail::FdManager::EV_HUP      ///< remote end closed connection
+          , EV_ERR = detail::FdManager::EV_ERR      ///< transport error
           , EV_ALL = (detail::FdManager::EV_READ 
                       | detail::FdManager::EV_WRITE 
-                      | detail::FdManager::EV_PRIO) ///< register all events
+                      | detail::FdManager::EV_PRIO) ///< register all events (read, prio and write)
         };
 
         ///////////////////////////////////////////////////////////////////////////
@@ -138,7 +138,6 @@ namespace scheduler {
 
        void disable();                 ///< Disable event
        void enable();                  ///< Enable event
-       bool enabled();                 ///< \c true if event enabled, \c false otherwise
 
        FdEvent & action(Callback const & cb); ///< Change event callback
 
@@ -157,7 +156,9 @@ namespace scheduler {
 
     private:
        virtual void signal(int events);
-       virtual void run();
+       virtual void v_run();
+        virtual char const * v_type() const;
+        virtual std::string v_info() const;
 
        Callback cb_;
        int fd_;
@@ -171,8 +172,14 @@ namespace scheduler {
         friend class detail::FileDispatcher;
     };
 
-    int retrieve_filehandle(int fd);
+    /** \brief Get file descriptor from handle object
 
+        This function will query the \a handle for it's file descriptor. The real implementation
+        must be provided by a freestanding function \c retrieve_filehandle(Handle const & h) within
+        the namespace of \a Handle.
+     */
+    template <class Handle>
+    int get_descriptor(Handle const & handle);
 }}
 
 ///////////////////////////////hh.e////////////////////////////////////////