#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 Types | |
using | Clock = std::chrono::steady_clock |
Private Member Functions | |
std::pair< bool, Clock::time_point > | 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 65 of file timer_queue.h.
|
private |
Definition at line 165 of file timer_queue.h.
|
inline |
Definition at line 68 of file timer_queue.h.
|
inline |
Definition at line 73 of file timer_queue.h.
|
privatedelete |
|
inline |
Adds a new timer.
Definition at line 85 of file timer_queue.h.
|
inlineprivate |
Definition at line 196 of file timer_queue.h.
|
inline |
Cancels the specified timer.
Definition at line 107 of file timer_queue.h.
|
inline |
Cancels all timers.
Definition at line 144 of file timer_queue.h.
|
inlineprivate |
Definition at line 218 of file timer_queue.h.
|
privatedelete |
|
inlineprivate |
Definition at line 169 of file timer_queue.h.
|
private |
Definition at line 233 of file timer_queue.h.
|
private |
Definition at line 235 of file timer_queue.h.
|
private |
Definition at line 236 of file timer_queue.h.
|
private |
|
private |
Definition at line 249 of file timer_queue.h.
|
private |
Definition at line 234 of file timer_queue.h.