mirror of
https://github.com/pocoproject/poco.git
synced 2025-02-12 18:35:15 +01:00
enh(Util): add Timer::taskCount()
This commit is contained in:
parent
5cab3be5c4
commit
6b324b83d4
@ -162,6 +162,9 @@ public:
|
||||
bool idle() const;
|
||||
/// 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>
|
||||
static TimerTask::Ptr func(const Fn& fn)
|
||||
/// 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
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user