class TQueue

template<typename T, QueueThreadingPolicy ThreadingPolicy = QueueThreadingPolicy::SingleThread, typename AllocatorTag = DefaultAllocatorTag>
Inherits: INonCopyable

Lock-free queue implemented as a linked list.

Supports multiple producer/single consumer, single producer/single consume and thread unsafe modes.

Public

Constructors

TQueue<T, ThreadingPolicy, AllocatorTag>

TQueue<T, ThreadingPolicy, AllocatorTag>()

Methods

~TQueue<T, ThreadingPolicy, AllocatorTag>

~TQueue<T, ThreadingPolicy, AllocatorTag>()

Dequeue

TOptional<T> Dequeue()

Removes an entry from the front of the queue.

Dequeue

bool Dequeue(T &outElement)

Removes an entry from the front of the queue.

Peek

T *Peek() const

Retrieves an entry from the front of the queue, without removing it.

Returns null if the queue is empty.

IsEmpty

bool IsEmpty() const

Returns true if the queue contains no entries.

Private

Fields

mHead

std::atomic<Node *> mHead

mTail

Node * mTail