Choose your operating system:
Windows
macOS
Linux
Module |
|
Header |
/Engine/Source/Runtime/Core/Public/Containers/CircularQueue.h |
Include |
#include "Containers/CircularQueue.h" |
template<typename T>
class TCircularQueue
Implements a lock-free first-in first-out queue using a circular array.
This class is thread safe only in single-producer single-consumer scenarios.
The number of items that can be enqueued is one less than the queue's capacity, because one item will be used for detecting full and empty states.
There is some room for optimization via using fine grained memory fences, but the implications for all of our target platforms need further analysis, so we're using the simpler sequentially consistent model for now.
Name | Description | |
---|---|---|
|
TCircularQueue ( |
Constructor. |
Name | Description | ||
---|---|---|---|
|
Count() |
Gets the number of elements in the queue. |
|
|
Dequeue() |
Removes an item from the front of the queue. |
|
|
Dequeue ( |
Removes an item from the front of the queue. |
|
|
Empty() |
Empties the queue. @note To be called only from consumer thread. |
|
|
Enqueue ( |
Adds an item to the end of the queue. |
|
|
Enqueue ( |
Adds an item to the end of the queue. |
|
|
IsEmpty() |
Checks whether the queue is empty. |
|
|
IsFull() |
Checks whether the queue is full. |
|
|
const FEleme... |
Peek() |
Returns the oldest item in the queue without removing it. |
|
Peek ( |
Returns the oldest item in the queue without removing it. |
Name |
Description |
---|---|
FElementType |