#include <C:/Work/specialnumbers_svn/NumberLib/NumbersLib/BufferedStep.h>
States are represented by integers in the range 0..n-1.
It is easier to predict the behaviour for this class if there exists a number k such that
0 < l_0 < h_0 < k < l_1 < h_1 < ... < l_i < h_i < i*k < ... < (n - 1)*k
is true. In this case, the states resemebles a chained sequence of BufferedBool instances, where each true state of one is associated with a
n | must be greater than 1, the number states. |
Definition at line 31 of file BufferedStep.h.
Public Member Functions | |
BufferedStep (float mMin, float mMax, float upwardsThresholds[n-1], float downwardsThresholds[n-1], float interval) | |
void | forceMax () |
void | forceMin () |
unsigned int | getState () const |
void | setStateUp (bool up) |
Static Private Member Functions | |
static int | indexFromState (int n) |
Private Attributes | |
float | mDownwardsThresholds [n-1] |
ClampedNumber< float > | mFloatValue |
ClampedNumber< int > | mState |
float | mUpwardsThresholds [n-1] |
BufferedStep | ( | float | mMin, | |
float | mMax, | |||
float | upwardsThresholds[n-1], | |||
float | downwardsThresholds[n-1], | |||
float | interval | |||
) | [inline] |
Definition at line 51 of file BufferedStep.h.
References BufferedStep::mDownwardsThresholds, and BufferedStep::mUpwardsThresholds.
void forceMax | ( | ) | [inline] |
Definition at line 99 of file BufferedStep.h.
References RangedNumber::max(), BufferedStep::mFloatValue, BufferedStep::mState, and RangedNumber::setValue().
void forceMin | ( | ) | [inline] |
Definition at line 92 of file BufferedStep.h.
References BufferedStep::mFloatValue, RangedNumber::min(), BufferedStep::mState, and RangedNumber::setValue().
unsigned int getState | ( | ) | const [inline] |
static int indexFromState | ( | int | n | ) | [inline, static, private] |
void setStateUp | ( | bool | up | ) | [inline] |
Definition at line 69 of file BufferedStep.h.
References BufferedStep::indexFromState(), BufferedStep::mDownwardsThresholds, BufferedStep::mFloatValue, BufferedStep::mState, and BufferedStep::mUpwardsThresholds.
float mDownwardsThresholds[n-1] [private] |
Definition at line 35 of file BufferedStep.h.
Referenced by BufferedStep::BufferedStep(), and BufferedStep::setStateUp().
ClampedNumber<float> mFloatValue [private] |
Definition at line 37 of file BufferedStep.h.
Referenced by BufferedStep::forceMax(), BufferedStep::forceMin(), and BufferedStep::setStateUp().
ClampedNumber<int> mState [private] |
Definition at line 36 of file BufferedStep.h.
Referenced by BufferedStep::forceMax(), BufferedStep::forceMin(), BufferedStep::getState(), and BufferedStep::setStateUp().
float mUpwardsThresholds[n-1] [private] |
Definition at line 34 of file BufferedStep.h.
Referenced by BufferedStep::BufferedStep(), and BufferedStep::setStateUp().