added PacketType typedef to PPI-writer interface
[senf.git] / Scheduler / TimerEvent.hh
index fa01767..6084f11 100644 (file)
@@ -1,6 +1,6 @@
 // $Id$
 //
-// Copyright (C) 2008 
+// Copyright (C) 2008
 // Fraunhofer Institute for Open Communication Systems (FOKUS)
 // Competence Center NETwork research (NET), St. Augustin, GERMANY
 //     Stefan Bund <g0dil@berlios.de>
@@ -23,8 +23,8 @@
 /** \file
     \brief TimerDispatcher public header */
 
-#ifndef HH_TimerDispatcher_
-#define HH_TimerDispatcher_ 1
+#ifndef HH_SENF_Scheduler_TimerEvent_
+#define HH_SENF_Scheduler_TimerEvent_ 1
 
 // Custom includes
 #include <signal.h>
@@ -49,13 +49,13 @@ namespace scheduler {
 
     /** \brief Deadline timer event
 
-        The TimerEvent class registeres a deadline timer callback which will be called when the
+        The TimerEvent class registers a deadline timer callback which will be called when the
         timer expires.
 
         Timer events are implemented using POSIX timers. Depending on kernel features, the timer
         resolution will be far more precise than the linux clock tick resolution. The nominal timer
         resolution is 1 nanosecond.
-        
+
         The timeout time is set as \e absolute time as returned by the senf::ClockService. After
         expiration, the timer will be disabled. It may be re-enabled by setting a new timeout time.
         It is also possible to change a running timer resetting the timeout time.
@@ -66,7 +66,7 @@ namespace scheduler {
         callback is a member function it should be defined as a class member).
      */
     class TimerEvent
-        : public FIFORunner::TaskInfo,
+        : public detail::FIFORunner::TaskInfo,
           public detail::TimerSetBase
     {
     public:
@@ -89,13 +89,15 @@ namespace scheduler {
                                              \param[in] name Descriptive timer name (purely
                                                  informational)
                                              \param[in] cb Callback to call
+                                             \param[in] timeout timeout time after the timer
+                                                 will be disabled
                                              \param[in] initiallyEnabled if set \c false, do not
                                                  enable callback automatically. */
         TimerEvent(std::string const & name, Callback const & cb);
                                         ///< Create a timer event
                                         /**< Creates a timer event for callback \a cb. The timer is
                                              initially disabled. Use the timeout() member to set the
-                                             timeout time. 
+                                             timeout time.
                                              \param[in] name Descriptive timer name (purely
                                                  informational)
                                              \param[in] cb Callback to call. */
@@ -106,7 +108,6 @@ namespace scheduler {
 
         void disable();                 ///< Disable timer
         void enable();                  ///< Enable timer
-        bool enabled();                 ///< \c true, if timer enabled, \c false otherwise        
 
         void action(Callback const & cb); ///< Change timer event callback
         void timeout(ClockService::clock_type timeout, bool initiallyEnabled=true);
@@ -114,9 +115,13 @@ namespace scheduler {
                                         /**< \param[in] timeout new timeout time
                                              \param[in] initiallyEnabled if set \c false, do not
                                                  enable callback automatically. */
+        ClockService::clock_type timeout() const;
+                                        ///< Get current/last timeout value
 
     private:
-        virtual void run();
+        virtual void v_run();
+        virtual char const * v_type() const;
+        virtual std::string v_info() const;
 
         Callback cb_;
         ClockService::clock_type timeout_;