#include <timer_queue.h>
Classes | |
class | Queue |
struct | WorkItem |
Public Member Functions | |
uint64_t | add (std::chrono::milliseconds milliseconds, std::function< void(bool)> handler) |
Adds a new timer. More... | |
size_t | cancel (uint64_t id) |
Cancels the specified timer. More... | |
size_t | cancelAll () |
Cancels all timers. More... | |
TimerQueue () | |
~TimerQueue () | |
Private Member Functions | |
std::pair< bool, std::chrono::time_point< _Clock, _Duration > > | calcWaitTime () |
void | checkWork () |
TimerQueue & | operator= (const TimerQueue &)=delete |
void | run () |
TimerQueue (const TimerQueue &)=delete | |
Private Attributes | |
details::Semaphore | m_checkWork |
bool | m_finish = false |
uint64_t | m_idcounter = 0 |
BT::TimerQueue::Queue | m_items |
std::mutex | m_mtx |
std::thread | m_th |
Definition at line 72 of file timer_queue.h.
|
inline |
Definition at line 75 of file timer_queue.h.
|
inline |
Definition at line 80 of file timer_queue.h.
|
privatedelete |
|
inline |
Adds a new timer.
Definition at line 92 of file timer_queue.h.
|
inlineprivate |
Definition at line 202 of file timer_queue.h.
|
inline |
Cancels the specified timer.
Definition at line 114 of file timer_queue.h.
|
inline |
Cancels all timers.
Definition at line 151 of file timer_queue.h.
|
inlineprivate |
Definition at line 224 of file timer_queue.h.
|
privatedelete |
|
inlineprivate |
Definition at line 175 of file timer_queue.h.
|
private |
Definition at line 241 of file timer_queue.h.
|
private |
Definition at line 243 of file timer_queue.h.
|
private |
Definition at line 244 of file timer_queue.h.
|
private |
|
private |
Definition at line 257 of file timer_queue.h.
|
private |
Definition at line 242 of file timer_queue.h.