Table of Contents

Class CircularBufferEx<TItem>

Namespace
Ecng.Collections
Assembly
Ecng.Collections.dll

CircularBuffer{TItem} with additional features.

public class CircularBufferEx<TItem> : CircularBuffer<TItem>, IList<TItem>, ICollection<TItem>, IEnumerable<TItem>, IEnumerable

Type Parameters

TItem
Inheritance
CircularBufferEx<TItem>
Implements
IList<TItem>
Inherited Members
Extension Methods

Constructors

CircularBufferEx(int)

Initializes a new instance of the CircularBufferEx<TItem>.

public CircularBufferEx(int capacity)

Parameters

capacity int

Capacity.

Properties

Capacity

Maximum capacity of the buffer. Elements pushed into the buffer after maximum capacity is reached (IsFull = true), will remove an element.

public override int Capacity { get; set; }

Property Value

int

Max

Max value.

public NullableEx<TItem> Max { get; }

Property Value

NullableEx<TItem>

MaxComparer

Calc Max.

public IComparer<TItem> MaxComparer { get; set; }

Property Value

IComparer<TItem>

Min

Min value.

public NullableEx<TItem> Min { get; }

Property Value

NullableEx<TItem>

MinComparer

Calc Min.

public IComparer<TItem> MinComparer { get; set; }

Property Value

IComparer<TItem>

Operator

Calc Sum.

public IOperator<TItem> Operator { get; set; }

Property Value

IOperator<TItem>

Sum

Sum of all elements in buffer.

public TItem Sum { get; }

Property Value

TItem

SumNoFirst

Sum of all elements in buffer without the first element.

public TItem SumNoFirst { get; }

Property Value

TItem

Methods

Clear()

Reset state.

public override void Clear()

PushBack(TItem)

Pushes a new element to the back of the buffer. Back()/this[Size-1] will now return this element.

When the buffer is full, the element at Front()/this[0] will be popped to allow for this new element to fit.

public override void PushBack(TItem result)

Parameters

result TItem