Boost  v1.57.0
doxygen for www.boost.org
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
boost::date_time::wrapping_int2< int_type_, wrap_min, wrap_max > Class Template Reference

A wrapping integer used to wrap around at the top (WARNING: only instantiate with a signed type) More...

#include <wrapping_int.hpp>

Public Types

typedef int_type_ int_type
 

Public Member Functions

 wrapping_int2 (int_type v)
 If initializing value is out of range of [wrap_min, wrap_max], value will be initialized to closest of min or max. More...
 
int_type as_int () const
 Explicit converion method. More...
 
 operator int_type () const
 
template<typename IntT >
IntT add (IntT v)
 Add, return number of wraps performed. More...
 
template<typename IntT >
IntT subtract (IntT v)
 Subtract will return '-d' if wrapping under took place ('d' is the number of wraps) More...
 

Static Public Member Functions

static int_type wrap_value ()
 
static int_type min_value ()
 

Detailed Description

template<typename int_type_, int_type_ wrap_min, int_type_ wrap_max>
class boost::date_time::wrapping_int2< int_type_, wrap_min, wrap_max >

A wrapping integer used to wrap around at the top (WARNING: only instantiate with a signed type)

Bad name, quick impl to fix a bug – fix later!! This allows the wrap to restart at a value other than 0.

Member Typedef Documentation

template<typename int_type_ , int_type_ wrap_min, int_type_ wrap_max>
typedef int_type_ boost::date_time::wrapping_int2< int_type_, wrap_min, wrap_max >::int_type

Constructor & Destructor Documentation

template<typename int_type_ , int_type_ wrap_min, int_type_ wrap_max>
boost::date_time::wrapping_int2< int_type_, wrap_min, wrap_max >::wrapping_int2 ( int_type  v)
inline

If initializing value is out of range of [wrap_min, wrap_max], value will be initialized to closest of min or max.

Member Function Documentation

template<typename int_type_ , int_type_ wrap_min, int_type_ wrap_max>
template<typename IntT >
IntT boost::date_time::wrapping_int2< int_type_, wrap_min, wrap_max >::add ( IntT  v)
inline

Add, return number of wraps performed.

The sign of the returned value will indicate which direction the wraps went. Ex: add a negative number and wrapping under could occur, this would be indicated by a negative return value. If wrapping over took place, a positive value would be returned

template<typename int_type_ , int_type_ wrap_min, int_type_ wrap_max>
int_type boost::date_time::wrapping_int2< int_type_, wrap_min, wrap_max >::as_int ( ) const
inline

Explicit converion method.

template<typename int_type_ , int_type_ wrap_min, int_type_ wrap_max>
static int_type boost::date_time::wrapping_int2< int_type_, wrap_min, wrap_max >::min_value ( )
inlinestatic
template<typename int_type_ , int_type_ wrap_min, int_type_ wrap_max>
boost::date_time::wrapping_int2< int_type_, wrap_min, wrap_max >::operator int_type ( ) const
inline
template<typename int_type_ , int_type_ wrap_min, int_type_ wrap_max>
template<typename IntT >
IntT boost::date_time::wrapping_int2< int_type_, wrap_min, wrap_max >::subtract ( IntT  v)
inline

Subtract will return '-d' if wrapping under took place ('d' is the number of wraps)

The sign of the returned value will indicate which direction the wraps went. Ex: subtract a negative number and wrapping over could occur, this would be indicated by a positive return value. If wrapping under took place, a negative value would be returned

template<typename int_type_ , int_type_ wrap_min, int_type_ wrap_max>
static int_type boost::date_time::wrapping_int2< int_type_, wrap_min, wrap_max >::wrap_value ( )
inlinestatic

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