From: mtk Date: Fri, 22 Apr 2011 19:41:31 +0000 (+0000) Subject: added a method() to query the number of active timer events X-Git-Url: http://g0dil.de/git?a=commitdiff_plain;h=ce3fd2d53ae43cc562e1df2a650e9637a80424c2;p=senf.git added a method() to query the number of active timer events git-svn-id: https://svn.berlios.de/svnroot/repos/senf/trunk@1785 270642c3-0616-0410-b53a-bc976706d245 --- diff --git a/senf/Scheduler/TimerEventProxy.ct b/senf/Scheduler/TimerEventProxy.ct index 3061b73..c9a58f6 100644 --- a/senf/Scheduler/TimerEventProxy.ct +++ b/senf/Scheduler/TimerEventProxy.ct @@ -105,6 +105,13 @@ prefix_ std::vector > senf::sc return tmp; } +template +prefix_ unsigned senf::scheduler::TimerEventProxy::numEvents() + const +{ + return entrySetByTimeout.size(); +} + //-///////////////////////////////////////////////////////////////////////////////////////////////// #undef prefix_ diff --git a/senf/Scheduler/TimerEventProxy.hh b/senf/Scheduler/TimerEventProxy.hh index d1fb5ad..c7ec857 100644 --- a/senf/Scheduler/TimerEventProxy.hh +++ b/senf/Scheduler/TimerEventProxy.hh @@ -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 {