Tanoda
LeapInternal.CircularObjectBuffer< T > Class Template Reference

Public Member Functions

 CircularObjectBuffer (int capacity)
 
virtual void Put (ref T item)
 
void Get (out T t, int index=0)
 
void Resize (int newCapacity)
 

Properties

int Count [get]
 
int Capacity [get]
 
bool IsEmpty [get]
 

Detailed Description

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.

Type Constraints
T :new() 

Definition at line 22 of file CircularObjectBuffer.cs.

Constructor & Destructor Documentation

◆ CircularObjectBuffer()

Definition at line 30 of file CircularObjectBuffer.cs.

Member Function Documentation

◆ Get()

void LeapInternal.CircularObjectBuffer< T >.Get ( out T  t,
int  index = 0 
)

Get the item indexed backward from the head of the list

Definition at line 58 of file CircularObjectBuffer.cs.

◆ Put()

virtual void LeapInternal.CircularObjectBuffer< T >.Put ( ref T  item)
virtual

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

Definition at line 39 of file CircularObjectBuffer.cs.

◆ Resize()

void LeapInternal.CircularObjectBuffer< T >.Resize ( int  newCapacity)

Increase

Definition at line 74 of file CircularObjectBuffer.cs.

Property Documentation

◆ Capacity

int LeapInternal.CircularObjectBuffer< T >.Capacity
get

Definition at line 27 of file CircularObjectBuffer.cs.

◆ Count

Definition at line 26 of file CircularObjectBuffer.cs.

◆ IsEmpty

bool LeapInternal.CircularObjectBuffer< T >.IsEmpty
get

Definition at line 28 of file CircularObjectBuffer.cs.


The documentation for this class was generated from the following file: