Crystal AI  1.0.0
Crystal.CircularBuffer< T > Class Template Reference

A circular buffer https://en.wikipedia.org/wiki/Circular_buffer. More...

Inheritance diagram for Crystal.CircularBuffer< T >:
Crystal.ICircularBuffer< T >

Public Member Functions

Enqueue (T item)
 Enqueue the specified item. More...
 
Dequeue ()
 Dequeue this instance. More...
 
void Clear ()
 Clears the buffer. More...
 
int IndexOf (T item)
 Returns the index of the first item equal to the query (item) if such an item exists within the buffer, -1 otherwise. More...
 
void RemoveAt (int index)
 Removes the element at the given index. More...
 
IEnumerator< T > GetEnumerator ()
 Gets the enumerator. More...
 
 CircularBuffer ()
 Initializes a new instance of the T:Crystal.CircularBuffer`1 class. More...
 
 CircularBuffer (int size)
 Initializes a new instance of the T:Crystal.CircularBuffer`1 class. More...
 

Properties

int Count [get]
 Number of elements in the buffer. More...
 
int Capacity [get, set]
 The maximum capacity of the buffer. More...
 
Head [get]
 Returns the value at the head of the buffer. More...
 
Tail [get]
 Returns the value at the tail of the buffer. More...
 
this[int index] [get, set]
 Gets or sets the T:Crystal.CircularBuffer`1 at the specified index. More...
 
- Properties inherited from Crystal.ICircularBuffer< T >
int Count [get]
 Number of elements in the buffer. More...
 
int Capacity [get, set]
 The maximum capacity of the buffer. More...
 
Head [get]
 Returns the value at the head of the buffer. More...
 
Tail [get]
 Returns the value at the tail of the buffer. More...
 
this[int index] [get, set]
 Gets or sets the T:Crystal.ICircularBuffer`1 at the specified index. More...
 

Detailed Description

A circular buffer https://en.wikipedia.org/wiki/Circular_buffer.

Template Parameters
T
See also
T:Crystal.ICircularBuffer`1, T:System.Collections.Generic.IEnumerable`1

Constructor & Destructor Documentation

Initializes a new instance of the T:Crystal.CircularBuffer`1 class.

Crystal.CircularBuffer< T >.CircularBuffer ( int  size)
inline

Initializes a new instance of the T:Crystal.CircularBuffer`1 class.

Parameters
sizeSize.

Member Function Documentation

void Crystal.CircularBuffer< T >.Clear ( )
inline

Clears the buffer.

Implements Crystal.ICircularBuffer< T >.

T Crystal.CircularBuffer< T >.Dequeue ( )
inline

Dequeue this instance.

Implements Crystal.ICircularBuffer< T >.

T Crystal.CircularBuffer< T >.Enqueue ( item)
inline

Enqueue the specified item.

Parameters
itemItem.

Implements Crystal.ICircularBuffer< T >.

IEnumerator<T> Crystal.CircularBuffer< T >.GetEnumerator ( )
inline

Gets the enumerator.

Returns
The enumerator.
int Crystal.CircularBuffer< T >.IndexOf ( item)
inline

Returns the index of the first item equal to the query (item) if such an item exists within the buffer, -1 otherwise.

Implements Crystal.ICircularBuffer< T >.

void Crystal.CircularBuffer< T >.RemoveAt ( int  index)
inline

Removes the element at the given index.

Parameters
indexIndex.

Implements Crystal.ICircularBuffer< T >.

Property Documentation

int Crystal.CircularBuffer< T >.Capacity
getset

The maximum capacity of the buffer.

The capacity.

int Crystal.CircularBuffer< T >.Count
get

Number of elements in the buffer.

The count.

T Crystal.CircularBuffer< T >.Head
get

Returns the value at the head of the buffer.

The head.

T Crystal.CircularBuffer< T >.Tail
get

Returns the value at the tail of the buffer.

The tail.

T Crystal.CircularBuffer< T >.this[int index]
getset

Gets or sets the T:Crystal.CircularBuffer`1 at the specified index.

Parameters
indexIndex.

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