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>

Constructors

RingBuffer ( capacity , defaultValue )
Allocates and initialises the buffer.
Signature
Oculus.Interaction.RingBuffer< T >.RingBuffer(int capacity, T defaultValue)
Parameters
capacity: int  The length of the buffer
defaultValue: T  The initialisation value

Properties

this[int index] : T
[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>
Signature
T Oculus.Interaction.RingBuffer< T >.this[int index]

Methods

Add ( item )
Inserts a value in the next entry of the buffer.
It overwrites the value already present there.
Signature
void Oculus.Interaction.RingBuffer< T >.Add(T item)
Parameters
item: T  The value to set
Returns
void  The element at the specified index in the buffer.
Clear ( clearValue )
Initialises the buffer setting all values to the clear value.
Signature
void Oculus.Interaction.RingBuffer< T >.Clear(T clearValue)
Parameters
clearValue: T  The value to set in all entries
Returns
void
Peek ( offset )
Signature
T Oculus.Interaction.RingBuffer< T >.Peek(int offset=0)
Parameters
offset: int
Returns
T