Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 1 | // Boost integer_fwd.hpp header file ---------------------------------------// |
| 2 | |
| 3 | // (C) Copyright Dave Abrahams and Daryle Walker 2001. Distributed under the Boost |
| 4 | // Software License, Version 1.0. (See accompanying file |
| 5 | // LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) |
| 6 | |
| 7 | // See http://www.boost.org/libs/integer for documentation. |
| 8 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 9 | #ifndef NDNBOOST_INTEGER_FWD_HPP |
| 10 | #define NDNBOOST_INTEGER_FWD_HPP |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 11 | |
| 12 | #include <climits> // for UCHAR_MAX, etc. |
| 13 | #include <cstddef> // for std::size_t |
| 14 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 15 | #include <ndnboost/config.hpp> // for NDNBOOST_NO_INTRINSIC_WCHAR_T |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 16 | #include <ndnboost/limits.hpp> // for std::numeric_limits |
| 17 | #include <ndnboost/cstdint.hpp> // For intmax_t |
| 18 | |
| 19 | |
| 20 | namespace ndnboost |
| 21 | { |
| 22 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 23 | #ifdef NDNBOOST_NO_INTEGRAL_INT64_T |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 24 | typedef unsigned long static_log2_argument_type; |
| 25 | typedef int static_log2_result_type; |
| 26 | typedef long static_min_max_signed_type; |
| 27 | typedef unsigned long static_min_max_unsigned_type; |
| 28 | #else |
| 29 | typedef ndnboost::uintmax_t static_min_max_unsigned_type; |
| 30 | typedef ndnboost::intmax_t static_min_max_signed_type; |
| 31 | typedef ndnboost::uintmax_t static_log2_argument_type; |
| 32 | typedef int static_log2_result_type; |
| 33 | #endif |
| 34 | |
| 35 | // From <ndnboost/cstdint.hpp> ------------------------------------------------// |
| 36 | |
| 37 | // Only has typedefs or using statements, with #conditionals |
| 38 | |
| 39 | |
| 40 | // From <ndnboost/integer_traits.hpp> -----------------------------------------// |
| 41 | |
| 42 | template < class T > |
| 43 | class integer_traits; |
| 44 | |
| 45 | template < > |
| 46 | class integer_traits< bool >; |
| 47 | |
| 48 | template < > |
| 49 | class integer_traits< char >; |
| 50 | |
| 51 | template < > |
| 52 | class integer_traits< signed char >; |
| 53 | |
| 54 | template < > |
| 55 | class integer_traits< unsigned char >; |
| 56 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 57 | #ifndef NDNBOOST_NO_INTRINSIC_WCHAR_T |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 58 | template < > |
| 59 | class integer_traits< wchar_t >; |
| 60 | #endif |
| 61 | |
| 62 | template < > |
| 63 | class integer_traits< short >; |
| 64 | |
| 65 | template < > |
| 66 | class integer_traits< unsigned short >; |
| 67 | |
| 68 | template < > |
| 69 | class integer_traits< int >; |
| 70 | |
| 71 | template < > |
| 72 | class integer_traits< unsigned int >; |
| 73 | |
| 74 | template < > |
| 75 | class integer_traits< long >; |
| 76 | |
| 77 | template < > |
| 78 | class integer_traits< unsigned long >; |
| 79 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 80 | #if !defined(NDNBOOST_NO_INTEGRAL_INT64_T) && !defined(NDNBOOST_NO_INT64_T) && defined(NDNBOOST_HAS_LONG_LONG) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 81 | template < > |
| 82 | class integer_traits< ::ndnboost::long_long_type>; |
| 83 | |
| 84 | template < > |
| 85 | class integer_traits< ::ndnboost::ulong_long_type >; |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 86 | #elif !defined(NDNBOOST_NO_INTEGRAL_INT64_T) && !defined(NDNBOOST_NO_INT64_T) && defined(NDNBOOST_HAS_MS_INT64) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 87 | template < > |
| 88 | class integer_traits<__int64>; |
| 89 | |
| 90 | template < > |
| 91 | class integer_traits<unsigned __int64>; |
| 92 | #endif |
| 93 | |
| 94 | |
| 95 | // From <ndnboost/integer.hpp> ------------------------------------------------// |
| 96 | |
| 97 | template < typename LeastInt > |
| 98 | struct int_fast_t; |
| 99 | |
| 100 | template< int Bits > |
| 101 | struct int_t; |
| 102 | |
| 103 | template< int Bits > |
| 104 | struct uint_t; |
| 105 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 106 | #if !defined(NDNBOOST_NO_INTEGRAL_INT64_T) && defined(NDNBOOST_HAS_LONG_LONG) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 107 | template< ndnboost::long_long_type MaxValue > // maximum value to require support |
| 108 | #else |
| 109 | template< long MaxValue > // maximum value to require support |
| 110 | #endif |
| 111 | struct int_max_value_t; |
| 112 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 113 | #if !defined(NDNBOOST_NO_INTEGRAL_INT64_T) && defined(NDNBOOST_HAS_LONG_LONG) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 114 | template< ndnboost::long_long_type MinValue > // minimum value to require support |
| 115 | #else |
| 116 | template< long MinValue > // minimum value to require support |
| 117 | #endif |
| 118 | struct int_min_value_t; |
| 119 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 120 | #if !defined(NDNBOOST_NO_INTEGRAL_INT64_T) && defined(NDNBOOST_HAS_LONG_LONG) |
Jeff Thompson | a28eed8 | 2013-08-22 16:21:10 -0700 | [diff] [blame] | 121 | template< ndnboost::ulong_long_type MaxValue > // maximum value to require support |
| 122 | #else |
| 123 | template< unsigned long MaxValue > // maximum value to require support |
| 124 | #endif |
| 125 | struct uint_value_t; |
| 126 | |
| 127 | |
| 128 | // From <ndnboost/integer/integer_mask.hpp> -----------------------------------// |
| 129 | |
| 130 | template < std::size_t Bit > |
| 131 | struct high_bit_mask_t; |
| 132 | |
| 133 | template < std::size_t Bits > |
| 134 | struct low_bits_mask_t; |
| 135 | |
| 136 | template < > |
| 137 | struct low_bits_mask_t< ::std::numeric_limits<unsigned char>::digits >; |
| 138 | |
| 139 | // From <ndnboost/integer/static_log2.hpp> ------------------------------------// |
| 140 | |
| 141 | template <static_log2_argument_type Value > |
| 142 | struct static_log2; |
| 143 | |
| 144 | template <> struct static_log2<0u>; |
| 145 | |
| 146 | |
| 147 | // From <ndnboost/integer/static_min_max.hpp> ---------------------------------// |
| 148 | |
| 149 | template <static_min_max_signed_type Value1, static_min_max_signed_type Value2> |
| 150 | struct static_signed_min; |
| 151 | |
| 152 | template <static_min_max_signed_type Value1, static_min_max_signed_type Value2> |
| 153 | struct static_signed_max; |
| 154 | |
| 155 | template <static_min_max_unsigned_type Value1, static_min_max_unsigned_type Value2> |
| 156 | struct static_unsigned_min; |
| 157 | |
| 158 | template <static_min_max_unsigned_type Value1, static_min_max_unsigned_type Value2> |
| 159 | struct static_unsigned_max; |
| 160 | |
| 161 | } // namespace ndnboost |
| 162 | |
| 163 | |
Jeff Thompson | 3d613fd | 2013-10-15 15:39:04 -0700 | [diff] [blame] | 164 | #endif // NDNBOOST_INTEGER_FWD_HPP |