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 IEnumerable<T>, IEnumerable
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>
Replace every item in the queue with the given value
public FixedSizeQueue<T> FillWith(T value)
value T
The value to replace all items with
FixedSizeQueue<T>
returns this
Enquene an element.
public void Enqueue(T item)
item T
public IEnumerator<T> GetEnumerator()
IEnumerator<T>