You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

llama.common.fixedsizequeue-1.md 1.8 kB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111
  1. # FixedSizeQueue<T>
  2. Namespace: LLama.Common
  3. A queue with fixed storage size.
  4. Currently it's only a naive implementation and needs to be further optimized in the future.
  5. ```csharp
  6. public class FixedSizeQueue<T> : , System.Collections.IEnumerable
  7. ```
  8. #### Type Parameters
  9. `T`<br>
  10. Inheritance [Object](https://docs.microsoft.com/en-us/dotnet/api/system.object) → [FixedSizeQueue&lt;T&gt;](./llama.common.fixedsizequeue-1.md)<br>
  11. Implements IEnumerable&lt;T&gt;, [IEnumerable](https://docs.microsoft.com/en-us/dotnet/api/system.collections.ienumerable)
  12. ## Properties
  13. ### **Count**
  14. ```csharp
  15. public int Count { get; }
  16. ```
  17. #### Property Value
  18. [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
  19. ### **Capacity**
  20. ```csharp
  21. public int Capacity { get; }
  22. ```
  23. #### Property Value
  24. [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
  25. ## Constructors
  26. ### **FixedSizeQueue(Int32)**
  27. ```csharp
  28. public FixedSizeQueue(int size)
  29. ```
  30. #### Parameters
  31. `size` [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
  32. ### **FixedSizeQueue(Int32, IEnumerable&lt;T&gt;)**
  33. ```csharp
  34. public FixedSizeQueue(int size, IEnumerable<T> data)
  35. ```
  36. #### Parameters
  37. `size` [Int32](https://docs.microsoft.com/en-us/dotnet/api/system.int32)<br>
  38. `data` IEnumerable&lt;T&gt;<br>
  39. ## Methods
  40. ### **FillWith(T)**
  41. ```csharp
  42. public FixedSizeQueue<T> FillWith(T value)
  43. ```
  44. #### Parameters
  45. `value` T<br>
  46. #### Returns
  47. [FixedSizeQueue&lt;T&gt;](./llama.common.fixedsizequeue-1.md)<br>
  48. ### **Enqueue(T)**
  49. Enquene an element.
  50. ```csharp
  51. public void Enqueue(T item)
  52. ```
  53. #### Parameters
  54. `item` T<br>
  55. ### **ToArray()**
  56. ```csharp
  57. public T[] ToArray()
  58. ```
  59. #### Returns
  60. T[]<br>
  61. ### **GetEnumerator()**
  62. ```csharp
  63. public IEnumerator<T> GetEnumerator()
  64. ```
  65. #### Returns
  66. IEnumerator&lt;T&gt;<br>