Lunchbox
1.6.0
|
A thread-safe, lock-free queue with non-blocking access. More...
#include <lfQueue.h>
Public Member Functions | |
LFQueue (const int32_t size) | |
Construct a new queue. | |
~LFQueue () | |
Destruct this queue. | |
bool | isEmpty () const |
void | clear () |
Reset (empty) the queue. | |
void | resize (const int32_t size) |
Resize and reset the queue. | |
bool | pop (T &result) |
Retrieve and pop the front element from the queue. | |
bool | getFront (T &result) |
Retrieve the front element from the queue. | |
bool | push (const T &element) |
Push a new element to the back of the queue. | |
size_t | getCapacity () const |
A thread-safe, lock-free queue with non-blocking access.
Typically used for caches and non-blocking communication between two execution threads.
Current implementation constraints:
lunchbox::LFQueue< T >::LFQueue | ( | const int32_t | size | ) | [inline] |
lunchbox::LFQueue< T >::~LFQueue | ( | ) | [inline] |
void lunchbox::LFQueue< T >::clear | ( | ) | [inline] |
size_t lunchbox::LFQueue< T >::getCapacity | ( | ) | const [inline] |
bool lunchbox::LFQueue< T >::getFront | ( | T & | result | ) | [inline] |
bool lunchbox::LFQueue< T >::isEmpty | ( | ) | const [inline] |
Definition at line 55 of file lfQueue.h.
Referenced by lunchbox::LFQueue< T >::resize().
bool lunchbox::LFQueue< T >::pop | ( | T & | result | ) | [inline] |
bool lunchbox::LFQueue< T >::push | ( | const T & | element | ) | [inline] |
void lunchbox::LFQueue< T >::resize | ( | const int32_t | size | ) | [inline] |
Resize and reset the queue.
This method is not thread-safe. The queue has to be empty.
Definition at line 71 of file lfQueue.h.
References lunchbox::LFQueue< T >::isEmpty().