Skip to content

FixedSizeQueue<T>

Namespace: LLama.Common

A queue with fixed storage size. Currently it's only a naive implementation and needs to be further optimized in the future.

1
public class FixedSizeQueue<T> : , , , System.Collections.IEnumerable

Type Parameters

T

Inheritance ObjectFixedSizeQueue<T>
Implements IReadOnlyList<T>, IReadOnlyCollection<T>, IEnumerable<T>, IEnumerable

Properties

Item

1
public T Item { get; }

Property Value

T

Count

Number of items in this queue

1
public int Count { get; }

Property Value

Int32

Capacity

Maximum number of items allowed in this queue

1
public int Capacity { get; }

Property Value

Int32

Constructors

FixedSizeQueue(Int32)

Create a new queue

1
public FixedSizeQueue(int size)

Parameters

size Int32
the maximum number of items to store in this queue

FixedSizeQueue(Int32, IEnumerable<T>)

Fill the quene with the data. Please ensure that data.Count <= size

1
public FixedSizeQueue(int size, IEnumerable<T> data)

Parameters

size Int32

data IEnumerable<T>

Methods

Enqueue(T)

Enquene an element.

1
public void Enqueue(T item)

Parameters

item T

GetEnumerator()

1
public IEnumerator<T> GetEnumerator()

Returns

IEnumerator<T>