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::int_adapter< int_type_ > Class Template Reference

Adapter to create integer types with +-infinity, and not a value. More...

#include <int_adapter.hpp>

Public Types

typedef int_type_ int_type
 

Public Member Functions

 int_adapter (int_type v)
 
bool is_infinity () const
 
bool is_pos_infinity () const
 
bool is_neg_infinity () const
 
bool is_nan () const
 
bool is_special () const
 
bool operator== (const int_adapter &rhs) const
 
bool operator== (const int &rhs) const
 
bool operator!= (const int_adapter &rhs) const
 
bool operator!= (const int &rhs) const
 
bool operator< (const int_adapter &rhs) const
 
bool operator< (const int &rhs) const
 
bool operator> (const int_adapter &rhs) const
 
int_type as_number () const
 
special_values as_special () const
 Returns either special value type or is_not_special. More...
 
template<class rhs_type >
int_adapter operator+ (const int_adapter< rhs_type > &rhs) const
 Operator allows for adding dissimilar int_adapter types. More...
 
int_adapter operator+ (const int_type rhs) const
 
template<class rhs_type >
int_adapter operator- (const int_adapter< rhs_type > &rhs) const
 Operator allows for subtracting dissimilar int_adapter types. More...
 
int_adapter operator- (const int_type rhs) const
 
int_adapter operator* (const int_adapter &rhs) const
 
int_adapter operator* (const int rhs) const
 Provided for cases when automatic conversion from 'int' to 'int_adapter' causes incorrect results. More...
 
int_adapter operator/ (const int_adapter &rhs) const
 
int_adapter operator/ (const int rhs) const
 Provided for cases when automatic conversion from 'int' to 'int_adapter' causes incorrect results. More...
 
int_adapter operator% (const int_adapter &rhs) const
 
int_adapter operator% (const int rhs) const
 Provided for cases when automatic conversion from 'int' to 'int_adapter' causes incorrect results. More...
 

Static Public Member Functions

static bool has_infinity ()
 
static const int_adapter pos_infinity ()
 
static const int_adapter neg_infinity ()
 
static const int_adapter not_a_number ()
 
static int_adapter max BOOST_PREVENT_MACRO_SUBSTITUTION ()
 
static int_adapter min BOOST_PREVENT_MACRO_SUBSTITUTION ()
 
static int_adapter from_special (special_values sv)
 
static bool is_inf (int_type v)
 
static bool is_neg_inf (int_type v)
 
static bool is_pos_inf (int_type v)
 
static bool is_not_a_number (int_type v)
 
static special_values to_special (int_type v)
 Returns either special value type or is_not_special. More...
 
static int_type maxcount ()
 

Detailed Description

template<typename int_type_>
class boost::date_time::int_adapter< int_type_ >

Adapter to create integer types with +-infinity, and not a value.

This class is used internally in counted date/time representations. It adds the floating point like features of infinities and not a number. It also provides mathmatical operations with consideration to special values following these rules:

+infinity - infinity == Not A Number (NAN)
infinity * non-zero == infinity
infinity * zero == NAN
+infinity * -integer == -infinity
infinity / infinity == NAN
infinity * infinity == infinity

Member Typedef Documentation

template<typename int_type_>
typedef int_type_ boost::date_time::int_adapter< int_type_ >::int_type

Constructor & Destructor Documentation

template<typename int_type_>
boost::date_time::int_adapter< int_type_ >::int_adapter ( int_type  v)
inline

Member Function Documentation

template<typename int_type_>
special_values boost::date_time::int_adapter< int_type_ >::as_special ( ) const
inline

Returns either special value type or is_not_special.

References boost::date_time::int_adapter< int_type_ >::to_special().

template<typename int_type_>
static int_adapter max boost::date_time::int_adapter< int_type_ >::BOOST_PREVENT_MACRO_SUBSTITUTION ( )
inlinestatic
template<typename int_type_>
static int_adapter min boost::date_time::int_adapter< int_type_ >::BOOST_PREVENT_MACRO_SUBSTITUTION ( )
inlinestatic
template<typename int_type_>
static bool boost::date_time::int_adapter< int_type_ >::has_infinity ( )
inlinestatic
template<typename int_type_>
bool boost::date_time::int_adapter< int_type_ >::is_neg_infinity ( ) const
inline
template<typename int_type_>
bool boost::date_time::int_adapter< int_type_ >::is_pos_infinity ( ) const
inline
template<typename int_type_>
static int_type boost::date_time::int_adapter< int_type_ >::maxcount ( )
inlinestatic
template<typename int_type_>
bool boost::date_time::int_adapter< int_type_ >::operator!= ( const int_adapter< int_type_ > &  rhs) const
inline
template<typename int_type_>
bool boost::date_time::int_adapter< int_type_ >::operator!= ( const int &  rhs) const
inline
template<typename int_type_>
int_adapter boost::date_time::int_adapter< int_type_ >::operator% ( const int  rhs) const
inline

Provided for cases when automatic conversion from 'int' to 'int_adapter' causes incorrect results.

References boost::date_time::int_adapter< int_type_ >::is_special().

template<typename int_type_>
int_adapter boost::date_time::int_adapter< int_type_ >::operator* ( const int_adapter< int_type_ > &  rhs) const
inline
template<typename int_type_>
int_adapter boost::date_time::int_adapter< int_type_ >::operator* ( const int  rhs) const
inline

Provided for cases when automatic conversion from 'int' to 'int_adapter' causes incorrect results.

References boost::date_time::int_adapter< int_type_ >::is_special().

template<typename int_type_>
int_adapter boost::date_time::int_adapter< int_type_ >::operator/ ( const int  rhs) const
inline

Provided for cases when automatic conversion from 'int' to 'int_adapter' causes incorrect results.

References boost::date_time::int_adapter< int_type_ >::is_special().

template<typename int_type_>
bool boost::date_time::int_adapter< int_type_ >::operator< ( const int_adapter< int_type_ > &  rhs) const
inline
template<typename int_type_>
bool boost::date_time::int_adapter< int_type_ >::operator< ( const int &  rhs) const
inline
template<typename int_type_>
bool boost::date_time::int_adapter< int_type_ >::operator== ( const int_adapter< int_type_ > &  rhs) const
inline
template<typename int_type_>
bool boost::date_time::int_adapter< int_type_ >::operator== ( const int &  rhs) const
inline
template<typename int_type_>
bool boost::date_time::int_adapter< int_type_ >::operator> ( const int_adapter< int_type_ > &  rhs) const
inline

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