libUTL++
|
Thread-safe fixed-size queue. More...
#include <RingBuffer.h>
Public Member Functions | |
void | set (size_t size) |
Initialize. More... | |
void | reset () |
Reset to default state. More... | |
size_t | count () const |
Sample a lower-bound on the number of contained items. More... | |
bool | enQ (T value) |
Try to queue an object. More... | |
bool | deQ (T &value) |
Try to dequeue an object. More... | |
void | forEach (std::function< void(T)> f) const |
Execute the given function on each contained value (not thread-safe!). More... | |
Thread-safe fixed-size queue.
Definition at line 19 of file RingBuffer.h.
void utl::RingBuffer< T, nullValue >::set | ( | size_t | size | ) |
void utl::RingBuffer< T, nullValue >::reset | ( | ) |
Reset to default state.
Definition at line 144 of file RingBuffer.h.
|
inline |
Sample a lower-bound on the number of contained items.
Definition at line 46 of file RingBuffer.h.
bool utl::RingBuffer< T, nullValue >::enQ | ( | T | value | ) |
Try to queue an object.
value | the value to en-q |
Definition at line 157 of file RingBuffer.h.
bool utl::RingBuffer< T, nullValue >::deQ | ( | T & | value | ) |
Try to dequeue an object.
value | target instance of T |
Definition at line 186 of file RingBuffer.h.
void utl::RingBuffer< T, nullValue >::forEach | ( | std::function< void(T)> | f | ) | const |
Execute the given function on each contained value (not thread-safe!).
Definition at line 214 of file RingBuffer.h.
References ASSERTD.