Table of Contents

Class Window

Namespace
Pamoja.Kit
Assembly
Pamoja.Kit.dll

A rolling window of the most recent readings, with the stats over them.

public sealed class Window : IDisposable
Inheritance
Window
Implements
Inherited Members

Remarks

The core helpers are generic over their capacity, which cannot cross the C ABI, so these are built at one documented size: Capacity.

Constructors

Window()

Creates an empty window.

public Window()

Exceptions

PamojaException

The native window could not be created.

Properties

Capacity

How many readings it holds before it starts dropping the oldest.

public int Capacity { get; }

Property Value

int

Count

How many readings the window holds.

public int Count { get; }

Property Value

int

Methods

Dispose()

Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.

public void Dispose()

Max()

The largest reading, or null while the window is empty.

public float? Max()

Returns

float?

The maximum, if there is one.

Mean()

The mean of the readings, or null while the window is empty.

public float? Mean()

Returns

float?

The mean, if there is one.

Min()

The smallest reading, or null while the window is empty.

public float? Min()

Returns

float?

The minimum, if there is one.

Push(float)

Adds a reading, dropping the oldest once the window is full.

public void Push(float reading)

Parameters

reading float

The reading to add.

Range()

The spread between the smallest and largest readings.

public float? Range()

Returns

float?

The range, if there is one.

Variance()

The variance of the readings, or null without enough of them.

public float? Variance()

Returns

float?

The variance, if there is one.