Template for circular buffers. 更多...
#include <CircularBuffer.h>
Public 成员函数 | |
| FORCEINLINE uint32 | Capacity () const |
| Returns the number of elements that the buffer can hold. 更多... | |
| FORCEINLINE uint32 | GetNextIndex (uint32 CurrentIndex) const |
| Calculates the index that follows the given index. 更多... | |
| FORCEINLINE uint32 | GetPreviousIndex (uint32 CurrentIndex) const |
| Calculates the index previous to the given index. 更多... | |
| FORCEINLINE ElementType & | operator[] (uint32 Index) |
| Returns the mutable element at the specified index. 更多... | |
| FORCEINLINE const ElementType & | operator[] (uint32 Index) const |
| Returns the immutable element at the specified index. 更多... | |
| TCircularBuffer (uint32 Capacity) | |
| Creates and initializes a new instance of the TCircularBuffer class. 更多... | |
| TCircularBuffer (uint32 Capacity, const ElementType &InitialValue) | |
| Creates and initializes a new instance of the TCircularBuffer class. 更多... | |
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.
|
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. |