CircularArray<T>
Represents a threadsafe circular array. A circular array has a maximum length, but items can always be added to it efficiently. Once the capacity has been reached, newly added items override the oldest items.
Type parameters:
| T | Array type. |
Constructors
Properties
Newest
#public T Newest { get; }
Gets the newest item added to the array. If the array contains no items, default(T) is returned.
Oldest
#public T Oldest { get; }
Gets the oldest item still in the array. If the array contains no items, default(T) is returned.
Methods
ToArray
#public T[] ToArray()
Create a correctly sized, correctly ordered array representing the current state of the circular array. The items in the returned array are sorted from oldest to newest.
Returns: Array of T.