EasyConsole
 All Classes Namespaces Functions Properties
Homans.Containers.CircularBuffer< T > Class Template Reference

A simple circular buffer. More...

List of all members.

Public Member Functions

 CircularBuffer (int maxCapacity, bool overwrite)
 Constructs a CircularBuffer with a defined maximum capacity.
void Enqueue (T item)
 adds an item to the end of the buffer
Dequeue ()
 removes and return the first item on the buffer
int Count ()
 Returns the current amount of items stored in the buffer.
GetItemAt (int index)
 Returns the item at the given index.
IEnumerator< T > GetEnumerator ()
 Returns an enumerator for an enumerator loop.

Detailed Description

template<T>
class Homans.Containers::CircularBuffer< T >

A simple circular buffer.

Template Parameters:
TThe type to store in the buffer

Member Function Documentation

template<T >
Homans.Containers.CircularBuffer< T >.CircularBuffer ( int  maxCapacity,
bool  overwrite 
)

Constructs a CircularBuffer with a defined maximum capacity.

Parameters:
maxCapacityThe maximum capacity
overwriteOverwrite old values if capacity is reached?
template<T >
int Homans.Containers.CircularBuffer< T >.Count ( )

Returns the current amount of items stored in the buffer.

Returns:
The item count
template<T >
T Homans.Containers.CircularBuffer< T >.Dequeue ( )

removes and return the first item on the buffer

Returns:
The first item in the buffer
template<T >
void Homans.Containers.CircularBuffer< T >.Enqueue ( item)

adds an item to the end of the buffer

Parameters:
itemThe item to push
template<T >
IEnumerator<T> Homans.Containers.CircularBuffer< T >.GetEnumerator ( )

Returns an enumerator for an enumerator loop.

Returns:
The enumerator
template<T >
T Homans.Containers.CircularBuffer< T >.GetItemAt ( int  index)

Returns the item at the given index.

Parameters:
indexThe item index
Returns:
The item

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