Navigation
API > API/Runtime > API/Runtime/NetCore
Simple ResizableCircularQueue. Relies on unsigned arithmetics and ever increasing head and tail indices to avoid having to store an extra element or maintain explicit empty state.
InitialCapacity must be a power of two.
| Name | TResizableCircularQueue |
| Type | class |
| Header File | /Engine/Source/Runtime/Net/Core/Public/Net/Core/Misc/ResizableCircularQueue.h |
| Include Path | #include "Net/Core/Misc/ResizableCircularQueue.h" |
Syntax
template<typename T, typename AllocatorT>
class TResizableCircularQueue
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
| Net/Core/Misc/ResizableCircularQueue.h | |||
TResizableCircularQueue
(
SIZE_T InitialCapacity |
Construct Empty Queue with the given initial Capacity, Capacity must be a power of two since we rely on unsigned arithmetics for wraparound | Net/Core/Misc/ResizableCircularQueue.h |
Destructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
~TResizableCircularQueue() |
Net/Core/Misc/ResizableCircularQueue.h |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| ElementT | T | Net/Core/Misc/ResizableCircularQueue.h | |
| IndexT | uint32 | Net/Core/Misc/ResizableCircularQueue.h | |
| StorageT | TArray< ElementT, AllocatorT > | Net/Core/Misc/ResizableCircularQueue.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| Head | IndexT | Net/Core/Misc/ResizableCircularQueue.h | ||
| IndexMask | IndexT | Net/Core/Misc/ResizableCircularQueue.h | ||
| Storage | StorageT | Net/Core/Misc/ResizableCircularQueue.h | ||
| Tail | IndexT | Net/Core/Misc/ResizableCircularQueue.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
SIZE_T AllocatedCapacity() |
Current allocated Capacity | Net/Core/Misc/ResizableCircularQueue.h | |
SIZE_T Count() |
Gets the number of elements in the queue. | Net/Core/Misc/ResizableCircularQueue.h | |
void Empty() |
Empty queue and release memory | Net/Core/Misc/ResizableCircularQueue.h | |
void Enqueue
(
const ElementT& SrcData |
Push single element to the back of the Queue | Net/Core/Misc/ResizableCircularQueue.h | |
ElementT & Enqueue () |
Push single element to the back of the Queue, returning a reference to it. | Net/Core/Misc/ResizableCircularQueue.h | |
ElementT & Enqueue_GetRef () |
Push single element to the back of the Queue, returning a reference to it. | Net/Core/Misc/ResizableCircularQueue.h | |
ElementT & EnqueueDefaulted_GetRef () |
Push single default constructed element to the back of the Queue, returning a reference to it. | Net/Core/Misc/ResizableCircularQueue.h | |
bool IsEmpty() |
Returns true if the queue is empty | Net/Core/Misc/ResizableCircularQueue.h | |
const ElementT & Peek() |
Peek at front element | Net/Core/Misc/ResizableCircularQueue.h | |
const ElementT & PeekAtOffset
(
SIZE_T Offset |
Peek with the given offset from the front of the queue | Net/Core/Misc/ResizableCircularQueue.h | |
const ElementT & PeekAtOffsetNoCheck
(
SIZE_T Offset |
Unchecked version, Peek with the given offset from the front of the queue | Net/Core/Misc/ResizableCircularQueue.h | |
const ElementT & PeekNoCheck() |
Peek at front element with no check | Net/Core/Misc/ResizableCircularQueue.h | |
ElementT & Poke() |
Peek at front element | Net/Core/Misc/ResizableCircularQueue.h | |
ElementT & PokeAtOffset
(
SIZE_T Offset |
Poke at the element with the given offset from the front of the queue | Net/Core/Misc/ResizableCircularQueue.h | |
ElementT & PokeAtOffsetNoCheck
(
SIZE_T Offset |
Unchecked version, Peek with the given offset from the front of the queue | Net/Core/Misc/ResizableCircularQueue.h | |
void Pop () |
Pop elements from the front of the queue | Net/Core/Misc/ResizableCircularQueue.h | |
void Pop
(
SIZE_T Count |
Pop Count elements from the front of the queue | Net/Core/Misc/ResizableCircularQueue.h | |
void PopNoCheck () |
Unchecked version, Pop a single element from the front of the queue | Net/Core/Misc/ResizableCircularQueue.h | |
void PopNoCheck
(
SIZE_T Count |
Unchecked version, Pop Count elements from the front of the queue | Net/Core/Misc/ResizableCircularQueue.h | |
void Reset() |
Empty queue without releasing memory | Net/Core/Misc/ResizableCircularQueue.h | |
void Trim() |
Trim memory usage to the next power of two for the current size | Net/Core/Misc/ResizableCircularQueue.h |