#include <C:/Work/specialnumbers_svn/NumberLib/NumbersLib/ClampedNumber.h>
T | It is unsafe to use this class with a number type whose min or max coincides with the ClampedNumber's min or max. For instance, do not use unsigned int if the range is between 0 and some positive number. |
Definition at line 27 of file ClampedNumber.h.
Public Member Functions | |
ClampedNumber (const ClampedNumber< T > &other) | |
Copies all attributes of the other clmaped number to this ClampedNumber. | |
ClampedNumber (T value, T min, T max, T increment) | |
Creates a ClampedNumber clamped between min and max - increment, with the given value. | |
virtual void | dec (float elapsedTime=1) |
virtual void | inc (float elapsedTime=1) |
virtual ClampedNumber< T > | operator++ (int) |
virtual ClampedNumber< T > & | operator++ () |
Puts this ClampedNumber's value onto the stream. | |
ClampedNumber< T > & | operator+= (const T &increment) |
Increments this CyclicNumber's value by the given increment, and waps it around. | |
virtual ClampedNumber< T > | operator-- (int) |
virtual ClampedNumber< T > & | operator-- () |
Decrements this RangedNumber by one increment, as specified by the constructor. | |
ClampedNumber< T > & | operator-= (const T &decrement) |
Decrements this CyclicNumber's value by the given increment, and waps it around. | |
ClampedNumber & | operator= (const ClampedNumber< T > &other) |
Returns this ClampedNumber's value. | |
Protected Member Functions | |
virtual T | getValidValue (const T &value) const |
ClampedNumber | ( | T | value, | |
T | min, | |||
T | max, | |||
T | increment | |||
) | [inline] |
Creates a ClampedNumber clamped between min and max - increment, with the given value.
The given vale is also clamped.
Definition at line 77 of file ClampedNumber.h.
ClampedNumber | ( | const ClampedNumber< T > & | other | ) | [inline] |
Copies all attributes of the other clmaped number to this ClampedNumber.
Definition at line 83 of file ClampedNumber.h.
void dec | ( | float | elapsedTime = 1 |
) | [inline, virtual] |
Implements RangedNumber.
Definition at line 168 of file ClampedNumber.h.
References luma::numbers::clamp(), and luma::numbers::frameRate.
Referenced by BufferedState::setValue(), and BufferedBool::setValue().
T getValidValue | ( | const T & | value | ) | const [inline, protected, virtual] |
Implements RangedNumber.
Definition at line 155 of file ClampedNumber.h.
References luma::numbers::clamp().
void inc | ( | float | elapsedTime = 1 |
) | [inline, virtual] |
Implements RangedNumber.
Definition at line 161 of file ClampedNumber.h.
References luma::numbers::clamp(), and luma::numbers::frameRate.
Referenced by BufferedState::setValue(), and BufferedBool::setValue().
ClampedNumber< T > operator++ | ( | int | ) | [inline, virtual] |
Definition at line 110 of file ClampedNumber.h.
ClampedNumber< T > & operator++ | ( | ) | [inline, virtual] |
Puts this ClampedNumber's value onto the stream.
Increments this RangedNumber by one increment, as specified by the constructor.
Implements RangedNumber.
Definition at line 101 of file ClampedNumber.h.
References luma::numbers::clamp().
ClampedNumber< T > & operator+= | ( | const T & | increment | ) | [inline] |
Increments this CyclicNumber's value by the given increment, and waps it around.
Definition at line 137 of file ClampedNumber.h.
References luma::numbers::clamp().
ClampedNumber< T > operator-- | ( | int | ) | [inline, virtual] |
Definition at line 128 of file ClampedNumber.h.
ClampedNumber< T > & operator-- | ( | ) | [inline, virtual] |
Decrements this RangedNumber by one increment, as specified by the constructor.
Implements RangedNumber.
Definition at line 119 of file ClampedNumber.h.
References luma::numbers::clamp().
ClampedNumber< T > & operator-= | ( | const T & | decrement | ) | [inline] |
Decrements this CyclicNumber's value by the given increment, and waps it around.
Definition at line 146 of file ClampedNumber.h.
References luma::numbers::clamp().
ClampedNumber< T > & operator= | ( | const ClampedNumber< T > & | other | ) | [inline] |
Returns this ClampedNumber's value.
Sets the value of this ClampedNumber to the value of the other value, and clamps it within this ClampedNumber's range. This ClampedNumber's range is not changed.
Definition at line 95 of file ClampedNumber.h.