API reference
API reference
Select your platform
No SDKs available
No versions available

RingBuffer Class

Implements a generic Ring Buffer data structure with a fixed capacity.
This buffer overwrites its elements in a circular manner when new elements are added beyond its capacity. /summary>

Properties

int Count[Get]
int Capacity[Get]
summary> Gets the element at a specified offset from the current head of the buffer.
It's useful for looking ahead or behind the buffer without altering its state. /summary>
Parameters
offset
The offset from the head of the buffer. Defaults to 0.
Returns
The element at the calculated position based on the offset.

Constructors & Destructors

Allocates and initialises the buffer.
Parameters
capacity
The length of the buffer
defaultValue
The initialisation value
Initialises the buffer.
Inserts a value in the next entry of the buffer.
It overwrites the value already present there.
Parameters
item
The value to set
summary> This indexer method provides read-only access to elements in the buffer. /summary>
Parameters
index
The index of the element to access.
Returns
The element at the specified index in the buffer.
T Peek
( int offset )