#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. | |
| size_t | cancel (uint64_t id) |
| Cancels the specified timer. | |
| size_t | cancelAll () |
| Cancels all timers. | |
| TimerQueue () | |
| ~TimerQueue () | |
Private Member Functions | |
| std::pair< bool, Clock::time_point > | calcWaitTime () |
| void | checkWork () |
| TimerQueue & | operator= (const TimerQueue &) |
| void | run () |
| TimerQueue (const TimerQueue &) | |
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.
| BT::TimerQueue::TimerQueue | ( | ) | [inline] |
Definition at line 68 of file timer_queue.h.
| BT::TimerQueue::~TimerQueue | ( | ) | [inline] |
Definition at line 73 of file timer_queue.h.
| BT::TimerQueue::TimerQueue | ( | const TimerQueue & | ) | [private] |
| uint64_t BT::TimerQueue::add | ( | std::chrono::milliseconds | milliseconds, |
| std::function< void(bool)> | handler | ||
| ) | [inline] |
Adds a new timer.
Definition at line 85 of file timer_queue.h.
| std::pair<bool, Clock::time_point> BT::TimerQueue::calcWaitTime | ( | ) | [inline, private] |
Definition at line 196 of file timer_queue.h.
| size_t BT::TimerQueue::cancel | ( | uint64_t | id | ) | [inline] |
Cancels the specified timer.
Definition at line 107 of file timer_queue.h.
| size_t BT::TimerQueue::cancelAll | ( | ) | [inline] |
Cancels all timers.
Definition at line 144 of file timer_queue.h.
| void BT::TimerQueue::checkWork | ( | ) | [inline, private] |
Definition at line 218 of file timer_queue.h.
| TimerQueue& BT::TimerQueue::operator= | ( | const TimerQueue & | ) | [private] |
| void BT::TimerQueue::run | ( | ) | [inline, private] |
Definition at line 169 of file timer_queue.h.
Definition at line 233 of file timer_queue.h.
bool BT::TimerQueue::m_finish = false [private] |
Definition at line 235 of file timer_queue.h.
uint64_t BT::TimerQueue::m_idcounter = 0 [private] |
Definition at line 236 of file timer_queue.h.
BT::TimerQueue::Queue BT::TimerQueue::m_items [private] |
std::mutex BT::TimerQueue::m_mtx [private] |
Definition at line 249 of file timer_queue.h.
std::thread BT::TimerQueue::m_th [private] |
Definition at line 234 of file timer_queue.h.