Struct NativeCircularBuffer 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
Clear ()

Resets the buffer's length to zero.

Public
Dispose ()

Releases the unmanaged memory held by this container.

Public
GetAbsolute (index)

Indexes the buffer using absolute indices.

Public
GetBoundaryValue (start)

Return either the first element or the last element.

Public
GetEnumerator ()
Public
GetEnumerator ()
Public
Grow ()
Public
MoveAbsolute (startIndex, endIndex, deltaIndex)
Public
NativeCircularBuffer (allocator)

Create a new empty buffer.

Public
NativeCircularBuffer (initialCapacity, allocator)

Create a new buffer with the given capacity.

Public
NativeCircularBuffer (buffer, gcHandle)
Public
NativeCircularBuffer (data, head, length, gcHandle)
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
TrimTo (length)

Lowers the length of the buffer to the given value, and does nothing if the given value is greater or equal to the current length.

Public

Public Variables

AbsoluteEndIndex

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

Public
AbsoluteStartIndex

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

Public
Allocator

The allocator used to create the internal buffer.

Public
Count
Public
First

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

Public
IsCreated
Public
Last

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

Public
Length

Number of items in the buffer.

Public
capacityMask

Capacity of the allocation minus 1.

Public
length
Public
this[int index]

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

Public

Private/Protected Members

data
Internal
head
Internal