Packets: Add StringParser ostream operation
[senf.git] / Scheduler / TimerSource.hh
index ae45048..c520348 100644 (file)
@@ -92,16 +92,31 @@ namespace detail {
         virtual void disable();
     };
 
+#ifdef HAVE_TIMERFD
     class TimerFDTimerSource
-        : public TimerSource
+        : public detail::FdManager::Event, public TimerSource
     {
     public:
+        TimerFDTimerSource();
+        ~TimerFDTimerSource();
+
         virtual void timeout(ClockService::clock_type timeout);
         virtual void notimeout();
 
         virtual void enable();
         virtual void disable();
+
+        static bool haveTimerFD();
+
+    private:
+        virtual void signal(int events);
+        void reschedule();
+
+        int timerfd_;
+        bool timeoutEnabled_;
+        ClockService::clock_type timeout_;
     };
+#endif
 
 }}}