Class LeapInternal::CircularObjectBuffer

class LeapInternal.CircularObjectBuffer<T>

A Limited capacity, circular LIFO buffer that wraps around when full. Supports indexing to get older items. Array-backed.

  • Unlike many collections, objects are never removed, just overwritten when the buffer cycles back to their array location.

Object types used must have default parameterless constructor. It should be obvious that such default objects are invalid. I.e. for Leap API objects, the IsValid property should be false.

Public Functions

virtual void Put (ref T item)

Put an item at the head of the list. Once full, this will overwrite the oldest item.

void Get (out T t, int index = 0)

Get the item indexed backward from the head of the list

void Resize (int newCapacity)

Increase