Navigation
API > API/Plugins > API/Plugins/Mover
Circular buffer specialized for use with rollback simulations providing concurrent access between active simulation and external users, as well as extra space for predictive work that's temporary and to be discarded.
This is based on TCircularBuffer's implementation. 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.
| Name | TRollbackCircularBuffer |
| Type | class |
| Header File | /Engine/Plugins/Experimental/Mover/Source/Mover/Public/MoveLibrary/RollbackCircularBuffer.h |
| Include Path | #include "MoveLibrary/RollbackCircularBuffer.h" |
Syntax
template<typename InElementType>
class TRollbackCircularBuffer
Constructors
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
TRollbackCircularBuffer
(
uint32 Capacity, |
Creates and initializes a new instance of the TRollbackCircularBuffer class. | MoveLibrary/RollbackCircularBuffer.h | |
TRollbackCircularBuffer
(
uint32 Capacity, |
Creates and initializes a new instance of the TRollbackCircularBuffer class. | MoveLibrary/RollbackCircularBuffer.h |
Typedefs
| Name | Type | Remarks | Include Path |
|---|---|---|---|
| ElementType | InElementType | MoveLibrary/RollbackCircularBuffer.h |
Variables
Protected
| Name | Type | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|---|
| Elements | TArray< ElementType > | Holds the buffer's elements. | MoveLibrary/RollbackCircularBuffer.h | |
| IndexMask | uint32 | Holds the mask for indexing the buffer's elements. | MoveLibrary/RollbackCircularBuffer.h | |
| NonPredictedCapacity | uint32 | This is the true number of usable element slots. | MoveLibrary/RollbackCircularBuffer.h |
Functions
Public
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
uint32 Capacity() |
Returns the number of elements that the buffer can naturally hold. | MoveLibrary/RollbackCircularBuffer.h | |
uint32 GetNextIndex
(
uint32 CurrentIndex |
Calculates the index that follows the given index. | MoveLibrary/RollbackCircularBuffer.h | |
ElementType & GetPredictiveElement () |
Returns the mutable predictive element. | MoveLibrary/RollbackCircularBuffer.h | |
const ElementType & GetPredictiveElement () |
Returns the immutable predictive element. | MoveLibrary/RollbackCircularBuffer.h | |
uint32 GetPreviousIndex
(
uint32 CurrentIndex |
Calculates the index previous to the given index. | MoveLibrary/RollbackCircularBuffer.h |
Operators
| Name | Remarks | Include Path | Unreal Specifiers |
|---|---|---|---|
ElementType & operator[]
(
uint32 Index |
Returns the mutable element at the specified index. | MoveLibrary/RollbackCircularBuffer.h | |
const ElementType & operator[]
(
uint32 Index |
Returns the immutable element at the specified index. | MoveLibrary/RollbackCircularBuffer.h |