Navigation
API > API/Runtime > API/Runtime/Core > API/Runtime/Core/Containers
References
| Module | Core |
| Header | /Engine/Source/Runtime/Core/Public/Containers/CircularBuffer.h |
| Include | #include "Containers/CircularBuffer.h" |
Syntax
template<typename InElementType>
class TCircularBuffer
Remarks
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.
Constructors
| Type | Name | Description | |
|---|---|---|---|
TCircularBuffer
(
uint32 Capacity |
Creates and initializes a new instance of the TCircularBuffer class. | ||
TCircularBuffer
(
uint32 Capacity, |
Creates and initializes a new instance of the TCircularBuffer class. |
Functions
| Type | Name | Description | |
|---|---|---|---|
| uint32 | Capacity () |
Returns the number of elements that the buffer can hold. | |
| uint32 | GetNextIndex
(
uint32 CurrentIndex |
Calculates the index that follows the given index. | |
| uint32 | GetPreviousIndex
(
uint32 CurrentIndex |
Calculates the index previous to the given index. |
Operators
| Type | Name | Description | |
|---|---|---|---|
| ElementType & | operator[]
(
uint32 Index |
Returns the mutable element at the specified index. | |
| const ElementType & | operator[]
(
uint32 Index |
Returns the immutable element at the specified index. |
Typedefs
| Name | Description |
|---|---|
| ElementType |