Classes | Public Member Functions | Private Member Functions | Private Attributes
BT::TimerQueue Class Reference

#include <timer_queue.h>

List of all members.

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

Detailed Description

Definition at line 65 of file timer_queue.h.


Constructor & Destructor Documentation

Definition at line 68 of file timer_queue.h.

Definition at line 73 of file timer_queue.h.

BT::TimerQueue::TimerQueue ( const TimerQueue ) [private]

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 ( ) [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.


Member Data Documentation

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.

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 Sat Feb 2 2019 03:50:10