Mozzi  version 2015-05-11-20:23
sound synthesis library for Arduino
 All Classes Functions Typedefs Groups
AutoRange< T > Class Template Reference

Keeps a running calculation of the range of the input values it receives. More...

#include <AutoRange.h>

Public Member Functions

 AutoRange (T min_expected, T max_expected)
 Constructor. More...
 
void next (T n)
 Updates the current range. More...
 
getMin ()
 Returns the current minimum. More...
 
getMax ()
 Returns the current maximum. More...
 
getRange ()
 Returns the current range. More...
 

Detailed Description

template<class T>
class AutoRange< T >

Keeps a running calculation of the range of the input values it receives.

Definition at line 18 of file AutoRange.h.

Constructor & Destructor Documentation

template<class T>
AutoRange< T >::AutoRange ( min_expected,
max_expected 
)
inline

Constructor.

Template Parameters
Tthe type of numbers to to use, eg. int, unsigned int, float etc.
Parameters
min_expectedthe minimum possible input value.
max_expectedthe maximum possible input value.

Definition at line 27 of file AutoRange.h.

Member Function Documentation

template<class T>
T AutoRange< T >::getMax ( )
inline

Returns the current maximum.

Returns
maximum

Definition at line 57 of file AutoRange.h.

template<class T>
T AutoRange< T >::getMin ( )
inline

Returns the current minimum.

Returns
minimum

Definition at line 49 of file AutoRange.h.

template<class T>
T AutoRange< T >::getRange ( )
inline

Returns the current range.

Returns
range

Definition at line 65 of file AutoRange.h.

template<class T>
void AutoRange< T >::next ( n)
inline

Updates the current range.

Parameters
nthe next value to include in the range calculation.

Definition at line 34 of file AutoRange.h.