PeanutButter
Loading...
Searching...
No Matches
PeanutButter.Utils.RollingWindow< T > Class Template Reference

More...

Inheritance diagram for PeanutButter.Utils.RollingWindow< T >:
PeanutButter.Utils.IRollingWindow< T >

Public Member Functions

 RollingWindow (long maxSize)
 Create a rolling window of max size maxSize.
void Add (T item)
 Add an item to the window, will discard any old items which exceed the configured window length.
Parameters
item

void Dispose ()
IEnumerator< T > GetEnumerator ()

Properties

long MaxSize [get, set]
 Get or set the maximum size for this window. If you set the MaxSize after construction to a value smaller than before and the RollingWindow is already at capacity, extraneous items will be trimmed.

Detailed Description

Member Function Documentation

◆ Add()

void PeanutButter.Utils.RollingWindow< T >.Add ( T item)

Add an item to the window, will discard any old items which exceed the configured window length.

Parameters
item

Implements PeanutButter.Utils.IRollingWindow< T >.

◆ RollingWindow()

PeanutButter.Utils.RollingWindow< T >.RollingWindow ( long maxSize)

Create a rolling window of max size maxSize.

Parameters
maxSize
Exceptions
ArgumentException

Property Documentation

◆ MaxSize

long PeanutButter.Utils.RollingWindow< T >.MaxSize
getset

Get or set the maximum size for this window. If you set the MaxSize after construction to a value smaller than before and the RollingWindow is already at capacity, extraneous items will be trimmed.

Implements PeanutButter.Utils.IRollingWindow< T >.


The documentation for this class was generated from the following file:
  • source/Utils/PeanutButter.Utils/RollingWindow.cs