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