Embedded Template Library 1.0
|
Classes | |
class | etl::cyclic_value< T, FIRST, LAST, false > |
class | etl::cyclic_value< T, FIRST, LAST, true > |
Provides a value that cycles between two limits.
class etl::cyclic_value< T, FIRST, LAST, false > |
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. |
Public Member Functions | |
cyclic_value () | |
cyclic_value (T initial) | |
cyclic_value (const cyclic_value< T, FIRST, LAST > &other) | |
Copy constructor. | |
cyclic_value & | operator= (const cyclic_value< T, FIRST, LAST > &other) |
Assignment operator. | |
void | set (T value_) |
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 FIRST2, const T LAST2> | |
cyclic_value & | operator= (const cyclic_value< T, FIRST2, LAST2 > &other) |
= operator. | |
T | get () const |
Gets the value. | |
const T | first () const |
Gets the first value. | |
const T | last () const |
Gets the last value. | |
void | swap (cyclic_value< T, FIRST, LAST > &other) |
Swaps the values. | |
Friends | |
void | swap (cyclic_value< T, FIRST, LAST > &lhs, cyclic_value< T, FIRST, LAST > &rhs) |
Swaps the values. | |
bool | operator== (const cyclic_value< T, FIRST, LAST > &lhs, const cyclic_value< T, FIRST, LAST > &rhs) |
Operator ==. | |
bool | operator!= (const cyclic_value< T, FIRST, LAST > &lhs, const cyclic_value< T, FIRST, LAST > &rhs) |
Operator !=. | |
|
inline |
Default constructor. The initial value is set to the first value.
|
inlineexplicit |
Constructor. Set to an initial value. Clamped to 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 value.
value | The value. |
class etl::cyclic_value< T, FIRST, LAST, true > |
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. |
Public Member Functions | |
cyclic_value () | |
cyclic_value (T first_, T last_) | |
cyclic_value (T first_, T last_, T initial) | |
cyclic_value (const cyclic_value &other) | |
Copy constructor. | |
void | set (T first_, T last_) |
void | set (T value_) |
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. | |
cyclic_value & | operator= (const cyclic_value &other) |
= operator. | |
T | get () const |
Gets the value. | |
T | first () const |
Gets the first value. | |
T | last () const |
Gets the last value. | |
void | swap (cyclic_value< T, FIRST, LAST > &other) |
Swaps the values. | |
Friends | |
void | swap (cyclic_value< T, FIRST, LAST > &lhs, cyclic_value< T, FIRST, LAST > &rhs) |
Swaps the values. | |
bool | operator== (const cyclic_value< T, FIRST, LAST > &lhs, const cyclic_value< T, FIRST, LAST > &rhs) |
Operator ==. | |
bool | operator!= (const cyclic_value< T, FIRST, LAST > &lhs, const cyclic_value< T, FIRST, LAST > &rhs) |
Operator !=. | |
|
inline |
Constructor. Sets 'first' and 'last' to the template parameter values. The initial value is set to the first value.
|
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 |
Constructor. Set to an initial value. Clamped to 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. |
|
inline |
Sets the value.
value | The value. |