![]() |
UDocumentation UE5.7 10.02.2026 (Source)
API documentation for Unreal Engine 5.7
|
#include <CircularBuffer.h>
Public Types | |
| using | ElementType = InElementType |
Public Member Functions | |
| TCircularBuffer (uint32 Capacity) | |
| TCircularBuffer (uint32 Capacity, const ElementType &InitialValue) | |
| UE_FORCEINLINE_HINT ElementType & | operator[] (uint32 Index) |
| UE_FORCEINLINE_HINT const ElementType & | operator[] (uint32 Index) const |
| UE_FORCEINLINE_HINT uint32 | Capacity () const |
| UE_FORCEINLINE_HINT uint32 | GetNextIndex (uint32 CurrentIndex) const |
| UE_FORCEINLINE_HINT uint32 | GetPreviousIndex (uint32 CurrentIndex) const |
Template for circular buffers.
The size of the buffer is rounded up to the next power of two in order speed up indexing operations using a simple bit mask instead of the commonly used modulus operator that may be slow on some platforms.
| using TCircularBuffer< InElementType >::ElementType = InElementType |
|
inlineexplicit |
Creates and initializes a new instance of the TCircularBuffer class.
| Capacity | The number of elements that the buffer can store (will be rounded up to the next power of 2). |
|
inline |
Creates and initializes a new instance of the TCircularBuffer class.
| Capacity | The number of elements that the buffer can store (will be rounded up to the next power of 2). |
| InitialValue | The initial value for the buffer's elements. |
|
inline |
Returns the number of elements that the buffer can hold.
|
inline |
Calculates the index that follows the given index.
| CurrentIndex | The current index. |
|
inline |
Calculates the index previous to the given index.
| CurrentIndex | The current index. |
|
inline |
Returns the mutable element at the specified index.
| Index | The index of the element to return. |
|
inline |
Returns the immutable element at the specified index.
| Index | The index of the element to return. |