#include <C:/Work/specialnumbers_svn/NumberLib/NumbersLib/BufferedNumber.h>
The value returned grows towards the value set at a maximum pace.
The function is updated everyTime setValue() is called.
The code of this documentation can be downloaded from http://www.luma.co.za/labs/2007/09/01/c-special-numbers-library/.
Definition at line 31 of file BufferedNumber.h.
Public Member Functions | |
BufferedNumber (T initialValue, T min, T max, T increment) | |
Constructs a new BufferedNumber. | |
void | forceValue (T value) |
Forces the value of this BufferedNumber to the given value. | |
T | getValue () const |
Returns the value of this buffered number. | |
void | setValue (T value, float elapsedTime=TIME_UNIT) |
Sets the next input sample for this BufferedNumber. | |
Private Attributes | |
Number | mIdealValue |
Number | mValue |
BufferedNumber | ( | T | initialValue, | |
T | min, | |||
T | max, | |||
T | increment | |||
) | [inline] |
Constructs a new BufferedNumber.
The number initial value is clamped between min and max.
Definition at line 65 of file BufferedNumber.h.
void forceValue | ( | T | value | ) | [inline] |
Forces the value of this BufferedNumber to the given value.
After this funcion has been called, the value returned by the next call to getValue will be the value passed to this function.
Definition at line 91 of file BufferedNumber.h.
References BufferedNumber::mIdealValue, and BufferedNumber::mValue.
T getValue | ( | ) | const [inline, virtual] |
Returns the value of this buffered number.
This value is always in the interval [min, max).
Implements UpdateableNumber.
Definition at line 72 of file BufferedNumber.h.
References BufferedNumber::mValue.
void setValue | ( | T | value, | |
float | elapsedTime = TIME_UNIT | |||
) | [inline, virtual] |
Sets the next input sample for this BufferedNumber.
Implements UpdateableNumber.
Definition at line 78 of file BufferedNumber.h.
References luma::numbers::frameRate, BufferedNumber::mIdealValue, and BufferedNumber::mValue.
Number mIdealValue [private] |
Definition at line 34 of file BufferedNumber.h.
Referenced by BufferedNumber::forceValue(), and BufferedNumber::setValue().
Number mValue [private] |
Definition at line 35 of file BufferedNumber.h.
Referenced by BufferedNumber::forceValue(), BufferedNumber::getValue(), and BufferedNumber::setValue().