Classes | Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
BT::TimerQueue Class Reference

#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 ()
 
TimerQueueoperator= (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
 

Detailed Description

Definition at line 65 of file timer_queue.h.

Member Typedef Documentation

using BT::TimerQueue::Clock = std::chrono::steady_clock
private

Definition at line 165 of file timer_queue.h.

Constructor & Destructor Documentation

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 )
privatedelete

Member Function Documentation

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 ( )
inlineprivate

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 ( )
inlineprivate

Definition at line 218 of file timer_queue.h.

TimerQueue& BT::TimerQueue::operator= ( const TimerQueue )
privatedelete
void BT::TimerQueue::run ( )
inlineprivate

Definition at line 169 of file timer_queue.h.

Member Data Documentation

details::Semaphore BT::TimerQueue::m_checkWork
private

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.


The documentation for this class was generated from the following file:


behaviortree_cpp
Author(s): Michele Colledanchise, Davide Faconti
autogenerated on Sun Feb 3 2019 03:14:33