Struct CircularBuffer Extends System::Collections::Generic::IReadOnlyList<T>, IReadOnlyCollection<T>

Public

Implements an efficient circular buffer that can be appended to in both directions.

Public Methods

AddRange (items)

Appends a list of items to the end of the buffer.

Public
CircularBuffer (initialCapacity)

Create a new buffer with the given capacity.

Public
CircularBuffer (backingArray)

Create a new buffer using the given array as an internal store.

Public
Clear ()

Resets the buffer's length to zero.

Public
Clone ()
Public
GetAbsolute (index)

Indexes the buffer using absolute indices.

Public Readonly
GetBoundaryValue (start)

Return either the first element or the last element.

Public Readonly
GetEnumerator ()
Public
GetEnumerator ()
Public
Grow ()
Public
MoveAbsolute (startIndex, endIndex, deltaIndex)
Public
Pool ()

Release the backing array of this buffer back into an array pool.

Public
Pop (fromStart)

Pops either from the start or from the end of the buffer.

Public
PopEnd ()

Removes and returns the last element.

Public
PopStart ()

Removes and returns the first element.

Public
Push (toStart, item)

Pushes a new item to the start or the end of the buffer.

Public
PushEnd (item)

Pushes a new item to the end of the buffer.

Public
PushStart (item)

Pushes a new item to the start of the buffer.

Public
Splice (startIndex, toRemove, toInsert)

Removes toRemove items from the buffer, starting at startIndex, and then inserts the toInsert items at startIndex.

Public
SpliceAbsolute (startIndex, toRemove, toInsert)

Like Splice, but startIndex is an absolute index.

Public
SpliceUninitialized (startIndex, toRemove, toInsert)

Like Splice, but the newly inserted items are left in an uninitialized state.

Public
SpliceUninitializedAbsolute (startIndex, toRemove, toInsert)

Like SpliceUninitialized, but startIndex is an absolute index.

Public

Public Variables

AbsoluteEndIndex

Absolute index of the last item in the buffer, may be negative or greater than Length.

Public Readonly
AbsoluteStartIndex

Absolute index of the first item in the buffer, may be negative or greater than Length.

Public Readonly
Count
Public Readonly
First

First item in the buffer, throws if the buffer is empty.

Public Readonly
Last

Last item in the buffer, throws if the buffer is empty.

Public Readonly
Length

Number of items in the buffer.

Public Readonly
length
Public
this[int index]

Indexes the buffer, with index 0 being the first element.

Public

Private/Protected Members

data
Internal
head
Internal