Public Member Functions | Private Attributes | List of all members
single_consumer_queue< T > Class Template Reference

#include <concurrency.h>

Public Member Functions

void blocking_enqueue (T &&item)
 
void clear ()
 
bool dequeue (T *item, unsigned int timeout_ms)
 
void enqueue (T &&item)
 
bool peek (T **item)
 
 single_consumer_queue (unsigned int cap=QUEUE_MAX_SIZE, std::function< void(T const &)> on_drop_callback=nullptr)
 
size_t size ()
 
void start ()
 
bool try_dequeue (T *item)
 

Private Attributes

bool _accepting
 
unsigned int _cap
 
std::condition_variable _deq_cv
 
std::condition_variable _enq_cv
 
std::mutex _mutex
 
std::atomic< bool > _need_to_flush
 
std::function< void(T const &)> _on_drop_callback
 
std::deque< T > _queue
 
std::atomic< bool > _was_flushed
 

Detailed Description

template<class T>
class single_consumer_queue< T >

Definition at line 15 of file concurrency.h.

Constructor & Destructor Documentation

template<class T>
single_consumer_queue< T >::single_consumer_queue ( unsigned int  cap = QUEUE_MAX_SIZE,
std::function< void(T const &)>  on_drop_callback = nullptr 
)
inlineexplicit

Definition at line 31 of file concurrency.h.

Member Function Documentation

template<class T>
void single_consumer_queue< T >::blocking_enqueue ( T &&  item)
inline

Definition at line 54 of file concurrency.h.

template<class T>
void single_consumer_queue< T >::clear ( )
inline

Definition at line 117 of file concurrency.h.

template<class T>
bool single_consumer_queue< T >::dequeue ( T *  item,
unsigned int  timeout_ms 
)
inline

Definition at line 69 of file concurrency.h.

template<class T>
void single_consumer_queue< T >::enqueue ( T &&  item)
inline

Definition at line 35 of file concurrency.h.

template<class T>
bool single_consumer_queue< T >::peek ( T **  item)
inline

Definition at line 105 of file concurrency.h.

template<class T>
size_t single_consumer_queue< T >::size ( )
inline

Definition at line 140 of file concurrency.h.

template<class T>
void single_consumer_queue< T >::start ( )
inline

Definition at line 133 of file concurrency.h.

template<class T>
bool single_consumer_queue< T >::try_dequeue ( T *  item)
inline

Definition at line 90 of file concurrency.h.

Member Data Documentation

template<class T>
bool single_consumer_queue< T >::_accepting
private

Definition at line 23 of file concurrency.h.

template<class T>
unsigned int single_consumer_queue< T >::_cap
private

Definition at line 22 of file concurrency.h.

template<class T>
std::condition_variable single_consumer_queue< T >::_deq_cv
private

Definition at line 19 of file concurrency.h.

template<class T>
std::condition_variable single_consumer_queue< T >::_enq_cv
private

Definition at line 20 of file concurrency.h.

template<class T>
std::mutex single_consumer_queue< T >::_mutex
private

Definition at line 18 of file concurrency.h.

template<class T>
std::atomic<bool> single_consumer_queue< T >::_need_to_flush
private

Definition at line 27 of file concurrency.h.

template<class T>
std::function<void(T const &)> single_consumer_queue< T >::_on_drop_callback
private

Definition at line 29 of file concurrency.h.

template<class T>
std::deque<T> single_consumer_queue< T >::_queue
private

Definition at line 17 of file concurrency.h.

template<class T>
std::atomic<bool> single_consumer_queue< T >::_was_flushed
private

Definition at line 28 of file concurrency.h.


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


librealsense2
Author(s): Sergey Dorodnicov , Doron Hirshberg , Mark Horn , Reagan Lopez , Itay Carpis
autogenerated on Mon May 3 2021 02:50:32