|
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114 |
- # 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.
-
- ```csharp
- public class FixedSizeQueue<T> : , System.Collections.IEnumerable
- ```
-
- #### Type Parameters
-
- `T`<br>
-
- Inheritance [Object](https://docs.microsoft.com/en-us/dotnet/api/system.object) → [FixedSizeQueue<T>](./llama.common.fixedsizequeue-1.md)<br>
- Implements IEnumerable<T>, [IEnumerable](https://docs.microsoft.com/en-us/dotnet/api/system.collections.ienumerable)
-
- ## Properties
-
- ### **Count**
-
- Number of items in this queue
-
- ```csharp
- public int Count { get; }
- ```
-
- #### Property Value
-
- [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
-
- ### **Capacity**
-
- Maximum number of items allowed in this queue
-
- ```csharp
- public int Capacity { get; }
- ```
-
- #### Property Value
-
- [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
-
- ## Constructors
-
- ### **FixedSizeQueue(Int32)**
-
- Create a new queue
-
- ```csharp
- public FixedSizeQueue(int size)
- ```
-
- #### Parameters
-
- `size` [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
- 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
-
- ```csharp
- public FixedSizeQueue(int size, IEnumerable<T> data)
- ```
-
- #### Parameters
-
- `size` [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
-
- `data` IEnumerable<T><br>
-
- ## Methods
-
- ### **FillWith(T)**
-
- Replace every item in the queue with the given value
-
- ```csharp
- public FixedSizeQueue<T> FillWith(T value)
- ```
-
- #### Parameters
-
- `value` T<br>
- The value to replace all items with
-
- #### Returns
-
- [FixedSizeQueue<T>](./llama.common.fixedsizequeue-1.md)<br>
- returns this
-
- ### **Enqueue(T)**
-
- Enquene an element.
-
- ```csharp
- public void Enqueue(T item)
- ```
-
- #### Parameters
-
- `item` T<br>
-
- ### **GetEnumerator()**
-
- ```csharp
- public IEnumerator<T> GetEnumerator()
- ```
-
- #### Returns
-
- IEnumerator<T><br>
|