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:
Definition at line 46 of file lfQueue.h.
eq::base::LFQueue< T >::LFQueue | ( | const int32_t | size ) | [inline] |
eq::base::LFQueue< T >::~LFQueue | ( | ) | [inline] |
void eq::base::LFQueue< T >::clear | ( | ) | [inline] |
size_t eq::base::LFQueue< T >::getCapacity | ( | ) | const [inline] |
bool eq::base::LFQueue< T >::getFront | ( | T & | result ) | [inline] |
bool eq::base::LFQueue< T >::isEmpty | ( | ) | const [inline] |
Definition at line 57 of file lfQueue.h.
Referenced by eq::base::LFQueue< T >::resize().
bool eq::base::LFQueue< T >::pop | ( | T & | result ) | [inline] |
bool eq::base::LFQueue< T >::push | ( | const T & | element ) | [inline] |
void eq::base::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 73 of file lfQueue.h.
References eq::base::LFQueue< T >::isEmpty().