mirror of
https://github.com/pocoproject/poco.git
synced 2025-04-18 23:41:08 +02:00
enh(Util): add Timer::taskCount()
This commit is contained in:
parent
5cab3be5c4
commit
6b324b83d4
@ -162,6 +162,9 @@ public:
|
|||||||
bool idle() const;
|
bool idle() const;
|
||||||
/// Returns true if the task queue is empty, otherwise false.
|
/// Returns true if the task queue is empty, otherwise false.
|
||||||
|
|
||||||
|
std::size_t taskCount() const;
|
||||||
|
/// Returns the number of tasks currently scheduled in the timer.
|
||||||
|
|
||||||
template <typename Fn>
|
template <typename Fn>
|
||||||
static TimerTask::Ptr func(const Fn& fn)
|
static TimerTask::Ptr func(const Fn& fn)
|
||||||
/// Helper function template to use a functor or lambda
|
/// Helper function template to use a functor or lambda
|
||||||
@ -200,6 +203,12 @@ inline bool Timer::idle() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline std::size_t Timer::taskCount() const
|
||||||
|
{
|
||||||
|
return _queue.size();
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
} } // namespace Poco::Util
|
} } // namespace Poco::Util
|
||||||
|
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user