94 #include <boost/version.hpp> 95 #include <boost/utility/enable_if.hpp> 96 #include <boost/archive/basic_binary_iprimitive.hpp> 97 #include <boost/archive/basic_binary_iarchive.hpp> 100 #include <boost/archive/detail/polymorphic_iarchive_route.hpp> 103 #include <boost/endian/conversion.hpp> 105 #if BOOST_VERSION < 106900 106 #include <boost/spirit/home/support/detail/math/fpclassify.hpp> 108 namespace fp = boost::spirit::math;
110 #if !defined(BOOST_MATH_DISABLE_STD_FPCLASSIFY) 111 #error "You must build using -DBOOST_MATH_DISABLE_STD_FPCLASSIFY!" 113 #include <boost/math/special_functions/fpclassify.hpp> 115 namespace fp = boost::math;
118 #ifndef BOOST_NO_STD_WSTRING 120 #include <boost/program_options/config.hpp> 121 #include <boost/program_options/detail/convert.hpp> 125 #include <boost/type_traits/is_integral.hpp> 126 #include <boost/type_traits/is_unsigned.hpp> 127 #include <boost/type_traits/is_arithmetic.hpp> 128 #include <boost/type_traits/is_floating_point.hpp> 132 namespace boost {
namespace archive {
137 typedef basic_binary_iprimitive <
139 , std::istream::char_type
140 , std::istream::traits_type
161 ,
public basic_binary_iarchive<portable_iarchive>
168 template <
int>
struct dummy { dummy(
int) {} };
171 inline signed char load_signed_char()
179 void init(
unsigned flags)
185 if (flags & no_header)
186 set_library_version(input_library_version);
190 throw archive_exception(archive_exception::invalid_signature);
195 operator>>(input_library_version);
199 throw archive_exception(archive_exception::unsupported_version);
202 else set_library_version(input_library_version);
238 #ifndef BOOST_NO_STD_WSTRING 255 s = boost::from_utf8(utf8);
274 switch (
signed char c = load_signed_char())
276 case 0: b =
false;
break;
277 case 1: b = load_signed_char();
break;
289 template <
typename T>
290 typename boost::enable_if<boost::is_integral<T> >::type
294 if (
signed char size = load_signed_char())
297 if (size < 0 && boost::is_unsigned<T>::value)
301 else if ((
unsigned)abs(size) >
sizeof(T))
305 T temp = size < 0 ? -1 : 0;
306 load_binary(&temp, abs(size));
309 t = boost::endian::little_to_native(temp);
342 template <
typename T>
343 typename boost::enable_if<boost::is_floating_point<T> >::type
346 typedef typename fp::detail::fp_traits<T>::type traits;
354 typename traits::bits bits;
355 BOOST_STATIC_ASSERT(
sizeof(bits) ==
sizeof(T));
356 BOOST_STATIC_ASSERT(std::numeric_limits<T>::is_iec559);
359 traits::set_bits(t, bits);
362 if (get_flags() &
no_infnan && !fp::isfinite(t))
368 if (std::numeric_limits<T>::has_denorm == std::denorm_absent
369 && fp::fpclassify(t) == (
int)FP_SUBNORMAL)
375 template <
typename T>
376 typename boost::disable_if<boost::is_arithmetic<T> >::type
384 load((
typename boost::uint_t<
sizeof(T)*CHAR_BIT>::least&)(t));
void load(bool &b)
Loading bool type.
Definition: portable_iarchive.hpp:272
const archive_version_type archive_version(BOOST_ARCHIVE_VERSION())
boost::disable_if< boost::is_arithmetic< T > >::type load(T &t, dummy< 4 >=0)
Definition: portable_iarchive.hpp:377
Provides error handling and constants.
detail::polymorphic_iarchive_route< portable_iarchive > polymorphic_portable_iarchive
Definition: portable_iarchive.hpp:389
const signed char magic_byte
Definition: portable_archive_exception.hpp:31
Serialization stuff for CLHEP 'vector_3d'.
Definition: portable_archive_exception.hpp:27
void load(Archive &a_ar, geomtools::vector_3d &v_, const unsigned int a_version)
void load(std::wstring &s)
Load wide strings.
Definition: portable_iarchive.hpp:251
Portable binary input archive using little endian format.
Definition: portable_iarchive.hpp:157
Exception being thrown when serialization cannot proceed.
Definition: portable_archive_exception.hpp:56
boost::enable_if< boost::is_integral< T > >::type load(T &t, dummy< 2 >=0)
Load integer types.
Definition: portable_iarchive.hpp:291
basic_binary_iprimitive< portable_iarchive, std::istream::char_type, std::istream::traits_type > portable_iprimitive
Definition: portable_iarchive.hpp:135
boost::enable_if< boost::is_floating_point< T > >::type load(T &t, dummy< 3 >=0)
Load floating point types.
Definition: portable_iarchive.hpp:344
portable_iarchive(std::streambuf &sb, unsigned flags=0)
Definition: portable_iarchive.hpp:225
portable_iarchive(std::istream &is, unsigned flags=0)
Constructor on a stream using ios::binary mode!
Definition: portable_iarchive.hpp:218
const unsigned no_infnan
Definition: portable_archive_exception.hpp:34
library_version_type archive_version_type
Definition: portable_archive_exception.hpp:37
void load(std::string &s)
Load narrow strings.
Definition: portable_iarchive.hpp:233