18 #ifndef LUNCHBOX_LFQUEUE_H 19 #define LUNCHBOX_LFQUEUE_H 21 #include <lunchbox/atomic.h> 22 #include <lunchbox/debug.h> 23 #include <lunchbox/thread.h> 57 bool isEmpty()
const {
return _readPos == _writePos; }
67 void resize(
const int32_t size);
96 bool push(
const T& element);
104 std::vector<T> _data;
113 #include "lfQueue.ipp" 115 #endif // LUNCHBOX_LFQUEUE_H bool pop(T &result)
Retrieve and pop the front element from the queue.
LFQueue(const int32_t size)
Construct a new queue.
void clear()
Reset (empty) the queue.
void resize(const int32_t size)
Resize and reset the queue.
bool getFront(T &result)
Retrieve the front element from the queue.
A thread-safe, lock-free queue with non-blocking access.
size_t getCapacity() const
Abstraction layer and common utilities for multi-threaded programming.
~LFQueue()
Destruct this queue.
bool push(const T &element)
Push a new element to the back of the queue.