Home | Libraries | People | FAQ | More |
boost::date_time::int_adapter — Adapter to create integer types with +-infinity, and not a value.
template<typename int_type_> class int_adapter { public: // types typedef int_type_ int_type; // construct/copy/destruct int_adapter(int_type); // public member functions 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 &) const; bool operator==(const int &) const; bool operator!=(const int_adapter &) const; bool operator!=(const int &) const; bool operator<(const int_adapter &) const; bool operator<(const int &) const; bool operator>(const int_adapter &) const; int_type as_number() const; special_values as_special() const; template<typename rhs_type> int_adapter operator+(const int_adapter< rhs_type > &) const; int_adapter operator+(const int_type) const; template<typename rhs_type> int_adapter operator-(const int_adapter< rhs_type > &) const; int_adapter operator-(const int_type) const; int_adapter operator *(const int_adapter &) const; int_adapter operator *(const int) const; int_adapter operator/(const int_adapter &) const; int_adapter operator/(const int) const; int_adapter operator%(const int_adapter &) const; int_adapter operator%(const int) const; // public static functions bool has_infinity() ; const int_adapter pos_infinity() ; const int_adapter neg_infinity() ; const int_adapter not_a_number() ; int_adapter max BOOST_PREVENT_MACRO_SUBSTITUTION() ; int_adapter min BOOST_PREVENT_MACRO_SUBSTITUTION() ; int_adapter from_special(special_values) ; bool is_inf(int_type) ; bool is_neg_inf(int_type) ; bool is_pos_inf(int_type) ; bool is_not_a_number(int_type) ; special_values to_special(int_type) ; int_type maxcount() ; // private member functions int compare(const int_adapter &) const; int_adapter mult_div_specials(const int_adapter &) const; int_adapter mult_div_specials(const int &) const; };
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 *
int_adapter
public member functionsbool 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;
template<typename rhs_type> int_adapter operator+(const int_adapter< rhs_type > & rhs) const;
Operator allows for adding dissimilar int_adapter types. The return type will match that of the the calling object's type
int_adapter operator+(const int_type rhs) const;
template<typename rhs_type> int_adapter operator-(const int_adapter< rhs_type > & rhs) const;
Operator allows for subtracting dissimilar int_adapter types. The return type will match that of the the calling object's type
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.
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.
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.
int_adapter
public static functionsbool has_infinity() ;
const int_adapter pos_infinity() ;
const int_adapter neg_infinity() ;
const int_adapter not_a_number() ;
int_adapter max BOOST_PREVENT_MACRO_SUBSTITUTION() ;
int_adapter min BOOST_PREVENT_MACRO_SUBSTITUTION() ;
int_adapter from_special(special_values sv) ;
bool is_inf(int_type v) ;
bool is_neg_inf(int_type v) ;
bool is_pos_inf(int_type v) ;
bool is_not_a_number(int_type v) ;
special_values to_special(int_type v) ;
int_type maxcount() ;
int_adapter
private member functionsint compare(const int_adapter & rhs) const;
int_adapter mult_div_specials(const int_adapter & rhs) const;
int_adapter mult_div_specials(const int & rhs) const;
Copyright © 2001-2005 CrystalClear Software, Inc |