BufferedStep Class Template Reference

#include <C:/Work/specialnumbers_svn/NumberLib/NumbersLib/BufferedStep.h>

List of all members.


Detailed Description

template<unsigned int n>
class luma::numbers::BufferedStep< n >

This class combines ideas from BufferedBool and BufferedState; it represents a linear progression of buffered states.

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

Parameters:
n must be greater than 1, the number states.
See also:
UpdateableNumber

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< floatmFloatValue
ClampedNumber< int > mState
float mUpwardsThresholds [n-1]

Constructor & Destructor Documentation

BufferedStep ( float  mMin,
float  mMax,
float  upwardsThresholds[n-1],
float  downwardsThresholds[n-1],
float  interval 
) [inline]


Member Function Documentation

void forceMax (  )  [inline]

void forceMin (  )  [inline]

unsigned int getState (  )  const [inline]

Definition at line 63 of file BufferedStep.h.

References BufferedStep::mState.

static int indexFromState ( int  n  )  [inline, static, private]

Definition at line 39 of file BufferedStep.h.

Referenced by BufferedStep::setStateUp().

void setStateUp ( bool  up  )  [inline]


Member Data Documentation

float mDownwardsThresholds[n-1] [private]

Definition at line 35 of file BufferedStep.h.

Referenced by BufferedStep::BufferedStep(), and BufferedStep::setStateUp().

ClampedNumber<int> mState [private]

float mUpwardsThresholds[n-1] [private]

Definition at line 34 of file BufferedStep.h.

Referenced by BufferedStep::BufferedStep(), and BufferedStep::setStateUp().


The documentation for this class was generated from the following file:

Generated on Sun Sep 21 20:49:08 2008 for Numbers by  doxygen 1.5.6