Table of Contents

Interface IRing<T>

Namespace
LfrlAnvil.Collections
Assembly
LfrlAnvil.Collections.dll

Represents a generic circular range of elements with constant Count.

public interface IRing<T> : IReadOnlyRing<T>, IReadOnlyList<T?>, IReadOnlyCollection<T?>, IEnumerable<T?>, IEnumerable

Type Parameters

T

Element type.

Inherited Members
Extension Methods

Properties

this[int]

Gets or sets an element at the specified position.

T? this[int index] { get; set; }

Parameters

index int

0-based element position.

Property Value

T

WriteIndex

Specifies a 0-based index of the next position that this ring will overwrite.

int WriteIndex { get; set; }

Property Value

int

Methods

Clear()

Resets all elements in this ring to default value and sets WriteIndex to 0.

void Clear()

SetNext(T)

Sets a value of the next element of this ring located at the WriteIndex and increments the WriteIndex by 1.

void SetNext(T item)

Parameters

item T

Value to set.

Exceptions

IndexOutOfRangeException

When size of this ring is equal to 0.