|
Embedded Template Library
1.0
|
#include <cyclic_value.h>
Public Member Functions | |
| cyclic_value () | |
| The initial value is set to the first value. More... | |
| cyclic_value (const T &first_, const T &last_) | |
| void | set (const T &first_, const T &last_) |
| void | to_first () |
| Resets the value to the first in the range. | |
| void | to_last () |
| Resets the value to the last in the range. | |
| void | advance (int n) |
| operator T () | |
| operator const T () const | |
| cyclic_value & | operator++ () |
| ++ operator. | |
| cyclic_value | operator++ (int) |
| ++ operator. | |
| cyclic_value & | operator-- () |
| – operator. | |
| cyclic_value | operator-- (int) |
| – operator. | |
| cyclic_value & | operator= (T t) |
| = operator. | |
| template<const T OTHER_FIRST, const T OTHER_LAST> | |
| cyclic_value & | operator= (const cyclic_value< T, OTHER_FIRST, OTHER_LAST > &other) |
| = operator. | |
| const T & | first () const |
| Gets the first value. | |
| const T & | last () const |
| Gets the last value. | |
| template<const T OTHER_FIRST, const T OTHER_LAST> | |
| void | swap (cyclic_value< T, OTHER_FIRST, OTHER_LAST > &other) |
| Swaps the values. | |
Friends | |
| template<typename U , const U OTHER_FIRST, const U OTHER_LAST> | |
| class | cyclic_value |
Provides a value that cycles between two limits. Supports incrementing and decrementing.
| T | The type of the variable. |
| FIRST | The first value of the range. |
| LAST | The last value of the range. |
|
inline |
The initial value is set to the first value.
Constructor. Sets 'first' and 'last' to the template parameter values.
|
inline |
Constructor. Sets the value to the first of the range.
| first | The first value in the range. |
| last | The last value in the range. |
|
inline |
Advances to value by a number of steps.
| n | The number of steps to advance. |
|
inline |
Const conversion operator.
|
inline |
Conversion operator.
|
inline |
Sets the range. Sets the value to the first of the range.
| first | The first value in the range. |
| last | The last value in the range. |