Карта сайта Kansoftware
НОВОСТИУСЛУГИРЕШЕНИЯКОНТАКТЫ
Разработка программного обеспечения

Class template int_adapter

Boost , The Boost C++ Libraries BoostBook Documentation Subset , Library Reference

Boost C++ Libraries

...one of the most highly regarded and expertly designed C++ library projects in the world. Herb Sutter and Andrei Alexandrescu, C++ Coding Standards

PrevUpHomeNext

Class template int_adapter

boost::date_time::int_adapter — Adapter to create integer types with +-infinity, and not a value.

Synopsis

// In header: <boost/date_time/int_adapter.hpp>
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
  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);
  static bool is_inf(int_type);
  static bool is_neg_inf(int_type);
  static bool is_pos_inf(int_type);
  static bool is_not_a_number(int_type);
  static special_values to_special(int_type);
  static 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;
};

Description

Этот класс используется внутренне в подсчитанных представлениях даты/времени. Он добавляет плавающую точку, как черты бесконечности, а не числа. Он также обеспечивает математические операции с учетом специальных значений, следующих этим правилам:

+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 construct/copy/destruct

  1. int_adapter(int_type v;

int_adapter public member functions

  1. bool is_infinity()const;
  2. bool is_pos_infinity()const;
  3. bool is_neg_infinity()const;
  4. bool is_nan()const;
  5. bool is_special()const;
  6. bool оператор==(const int_adapter& rhsconst
  7. boolоператор==(constint& rhsconst
  8. boolоператор!=(const int_adapter& rhsconst;
  9. boolоператор!=(constint& rhs>const
  10. boolоператор<(const int_adapter& rhsconst
  11. boolоператор<(constint& rhsconst
  12. boolоператор>(const int_adapter& rhsconst;
  13. int_type as_number()const;
  14. special_values as_special() const;
    Возвращает либо специальный тип значения, либо является_not_special.
  15. templatetypename rhs_type> int_adapterоператор(constint_adapter< rhs_type >  rhs;const;

    Оператор допускает добавление разнородных int_adapter типов. Тип возврата будет соответствовать типу вызывающего объекта

  16. int_adapterоператор(const int_type rhsconst;
  17. templatetypename rhs_type> int_adapterоператор-constint_adapter< rhs_type >  rhs;const;

    Оператор позволяет вычитать несхожие типы int_adapter. Тип возврата будет соответствовать типу вызывающего объекта

  18. int_adapterоператор-(const int_type rhsconst;
  19. int_adapterоператор(конст int_adapter& rhsконст;
  20. int_adapterоператор(const int rhs) const;

    Предусмотрено для случаев, когда автоматическое преобразование из 'int' в 'int_adapter вызывает неправильные результаты.

  21. int_adapterоператор/(констint_adapter& rhsконст;
  22. int_adapterоператор/(const rhs) const;

    Предусмотрено для случаев, когда автоматическое преобразование из 'int' в 'int_adapter вызывает неправильные результаты.

  23. int_adapterоператор%(const int_adapter& rhsconst;
  24. int_adapterоператор(const int rhs) const;

    Предусмотрено для случаев, когда автоматическое преобразование из 'int' в 'int_adapter вызывает неправильные результаты.

int_adapter public static functions

  1. static bool has_infinity();
  2. static const int_adapterpos_infinity;
  3. static const int_adapterneg_infinity(;
  4. static const int_adapternot_a_number;
  5. static int_adapter maxBOOST_PREVENT_MACRO_SUBSTITUTION;
  6. static int_adapter minBOOST_PREVENT_MACRO_SUBSTITUTION;
  7. static int_adapter from_specialspecial_valuessv;
  8. static boolis_infint_type v;
  9. static bool is_neg_infint_type v;
  10. static boolis_pos_infint_type v;
  11. static boolis_not_a_numberint_type v;
  12. static special_valuesto_special(int_type v);
    Возвращает либо специальный тип значения, либо является_not_special.
  13. static int_type maxcount();

int_adapter private member functions

  1. int compare(const int_adapter & rhs) const;
    возвращает -1, 0, 1, или 2, если 'это' является <, ==, >, или 'нан-сравнение rhs
  2. int_adapter mult_div_specials(const int_adapter & rhs) const;
    Предполагает, что по меньшей мере "это" или "рхс" является особым значением.
  3. int_adapter mult_div_specials(const int & rhs) const;
    Предполагает, что 'это' является особым значением.

PrevUpHomeNext

Статья Class template int_adapter раздела The Boost C++ Libraries BoostBook Documentation Subset Library Reference может быть полезна для разработчиков на c++ и boost.




Материалы статей собраны из открытых источников, владелец сайта не претендует на авторство. Там где авторство установить не удалось, материал подаётся без имени автора. В случае если Вы считаете, что Ваши права нарушены, пожалуйста, свяжитесь с владельцем сайта.



:: Главная :: Library Reference ::


реклама


©KANSoftWare (разработка программного обеспечения, создание программ, создание интерактивных сайтов), 2007
Top.Mail.Ru

Время компиляции файла: 2024-08-30 11:47:00
2025-07-04 17:13:28/0.0051209926605225/0