Embedded Template Library  1.0
 All Classes Files Functions Variables Typedefs Friends Modules Pages
etl::cyclic_value< T, FIRST, LAST > Class Template Reference

#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_valueoperator++ ()
 ++ operator.
 
cyclic_value operator++ (int)
 ++ operator.
 
cyclic_valueoperator-- ()
 – operator.
 
cyclic_value operator-- (int)
 – operator.
 
cyclic_valueoperator= (T t)
 = operator.
 
template<const T OTHER_FIRST, const T OTHER_LAST>
cyclic_valueoperator= (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
 

Detailed Description

template<typename T, const T FIRST = T(), const T LAST = T()>
class etl::cyclic_value< T, FIRST, LAST >

Provides a value that cycles between two limits. Supports incrementing and decrementing.

Template Parameters
TThe type of the variable.
FIRSTThe first value of the range.
LASTThe last value of the range.

Constructor & Destructor Documentation

template<typename T, const T FIRST = T(), const T LAST = T()>
etl::cyclic_value< T, FIRST, LAST >::cyclic_value ( )
inline

The initial value is set to the first value.

Constructor. Sets 'first' and 'last' to the template parameter values.

template<typename T, const T FIRST = T(), const T LAST = T()>
etl::cyclic_value< T, FIRST, LAST >::cyclic_value ( const T &  first_,
const T &  last_ 
)
inline

Constructor. Sets the value to the first of the range.

Parameters
firstThe first value in the range.
lastThe last value in the range.

Member Function Documentation

template<typename T, const T FIRST = T(), const T LAST = T()>
void etl::cyclic_value< T, FIRST, LAST >::advance ( int  n)
inline

Advances to value by a number of steps.

Parameters
nThe number of steps to advance.
template<typename T, const T FIRST = T(), const T LAST = T()>
etl::cyclic_value< T, FIRST, LAST >::operator const T ( ) const
inline

Const conversion operator.

Returns
The value of the underlying type.
template<typename T, const T FIRST = T(), const T LAST = T()>
etl::cyclic_value< T, FIRST, LAST >::operator T ( )
inline

Conversion operator.

Returns
The value of the underlying type.
template<typename T, const T FIRST = T(), const T LAST = T()>
void etl::cyclic_value< T, FIRST, LAST >::set ( const T &  first_,
const T &  last_ 
)
inline

Sets the range. Sets the value to the first of the range.

Parameters
firstThe first value in the range.
lastThe last value in the range.

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