added a method() to query the number of active timer events
mtk [Fri, 22 Apr 2011 19:41:31 +0000 (19:41 +0000)]
git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1785 270642c3-0616-0410-b53a-bc976706d245

senf/Scheduler/TimerEventProxy.ct
senf/Scheduler/TimerEventProxy.hh

index 3061b73..c9a58f6 100644 (file)
@@ -105,6 +105,13 @@ prefix_ std::vector<std::pair<senf::ClockService::clock_type, IdType> > senf::sc
     return tmp;
 }
 
+template<typename IdType>
+prefix_ unsigned senf::scheduler::TimerEventProxy<IdType>::numEvents()
+  const
+{
+  return entrySetByTimeout.size();
+}
+
 //-/////////////////////////////////////////////////////////////////////////////////////////////////
 #undef prefix_
 
index d1fb5ad..c7ec857 100644 (file)
@@ -69,6 +69,9 @@ namespace scheduler {
         ClockService::clock_type timeout(IdType const & id) const;
                                         ///< Returns timeout for given id
                                         /**< if no timer for this id is registered \a 0 is returned. */
+
+        unsigned numEvents() const;  ///< Returns the number of pending timer events 
+        
     private:
 #ifndef DOXYGEN
         struct Entry {