TResizableCircularQueue

Simple ResizableCircularQueue.

Windows
MacOS
Linux

References

Module

NetCore

Header

/Engine/Source/Runtime/Net/Core/Public/Net/Core/Misc/ResizableCircularQueue.h

Include

#include "Net/Core/Misc/ResizableCircularQueue.h"

Syntax

template<typename T, typename AllocatorT>
class TResizableCircularQueue

Remarks

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.

Constructors

Name Description

Public function

TResizableCircularQueue()

Public function

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

Destructors

Name Description

Public function

~TResizableCircularQueue()

Functions

Name Description

Public function Const

SIZE_T

 

AllocatedCapacity()

Current allocated Capacity

Public function Const

SIZE_T

 

Count()

Gets the number of elements in the queue.

Public function

void

 

Empty()

Empty queue and release memory

Public function

void

 

Enqueue

(
    const ElementT& SrcData
)

Push single element to the back of the Queue

Public function

ElementT &

 

Enqueue()

Push single element to the back of the Queue, returning a reference to it.

Public function

ElementT &

 

Enqueue_GetRef()

Push single element to the back of the Queue, returning a reference to it.

Public function

ElementT &

 

EnqueueDefaulted_GetRef()

Push single default constructed element to the back of the Queue, returning a reference to it.

Public function Const

bool

 

IsEmpty()

Returns true if the queue is empty

Public function Const

const Elemen...

 

Peek()

Peek at front element

Public function Const

const Elemen...

 

PeekAtOffset

(
    SIZE_T Offset
)

Peek with the given offset from the front of the queue

Public function Const

const Elemen...

 

PeekAtOffsetNoCheck

(
    SIZE_T Offset
)

Unchecked version, Peek with the given offset from the front of the queue

Public function Const

const Elemen...

 

PeekNoCheck()

Peek at front element with no check

Public function

ElementT &

 

Poke()

Peek at front element

Public function

ElementT &

 

PokeAtOffset

(
    SIZE_T Offset
)

Poke at the element with the given offset from the front of the queue

Public function

ElementT &

 

PokeAtOffsetNoCheck

(
    SIZE_T Offset
)

Unchecked version, Peek with the given offset from the front of the queue

Public function

void

 

Pop()

Pop elements from the front of the queue

Public function

void

 

Pop

(
    SIZE_T Count
)

Pop Count elements from the front of the queue

Public function

void

 

PopNoCheck()

Unchecked version, Pop a single element from the front of the queue

Public function

void

 

PopNoCheck

(
    SIZE_T Count
)

Unchecked version, Pop Count elements from the front of the queue

Public function

void

 

Reset()

Empty queue without releasing memory

Public function

void

 

Trim()

Trim memory usage to the next power of two for the current size

Typedefs

Name

Description

ElementT

IndexT

StorageT

Constants

Help shape the future of Unreal Engine documentation! Tell us how we're doing so we can serve you better.
Take our survey
Dismiss