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.
public class FixedSizeQueue<T> : , , , System.Collections.IEnumerable
T
Inheritance Object → FixedSizeQueue<T>
Implements IReadOnlyList<T>, IReadOnlyCollection<T>, IEnumerable<T>, IEnumerable
public T Item { get; }
T
Number of items in this queue
public int Count { get; }
Maximum number of items allowed in this queue
public int Capacity { get; }
Create a new queue
public FixedSizeQueue(int size)
size Int32
the maximum number of items to store in this queue
Fill the quene with the data. Please ensure that data.Count <= size
public FixedSizeQueue(int size, IEnumerable<T> data)
size Int32
data IEnumerable<T>
Enquene an element.
public void Enqueue(T item)
item T
public IEnumerator<T> GetEnumerator()
IEnumerator<T>