Chris@16: #ifndef BOOST_SERIALIZATION_COLLECTION_TRAITS_HPP Chris@16: #define BOOST_SERIALIZATION_COLLECTION_TRAITS_HPP Chris@16: Chris@16: // MS compatible compilers support #pragma once Chris@101: #if defined(_MSC_VER) Chris@16: # pragma once Chris@16: #endif Chris@16: Chris@16: /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 Chris@16: // collection_traits.hpp: Chris@16: Chris@16: // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . Chris@16: // Use, modification and distribution is subject to the Boost Software Chris@16: // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at Chris@16: // http://www.boost.org/LICENSE_1_0.txt) Chris@16: Chris@16: // See http://www.boost.org for updates, documentation, and revision history. Chris@16: Chris@16: // This header assigns a level implemenation trait to a collection type Chris@16: // for all primitives. It is needed so that archives which are meant to be Chris@16: // portable don't write class information in the archive. Since, not all Chris@16: // compiles recognize the same set of primitive types, the possibility Chris@16: // exists for archives to be non-portable if class information for primitive Chris@16: // types is included. This is addressed by the following macros. Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: Chris@16: #include Chris@16: #include Chris@16: #include // ULONG_MAX Chris@16: #include Chris@16: Chris@16: #define BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(T, C) \ Chris@16: template<> \ Chris@16: struct implementation_level< C < T > > { \ Chris@16: typedef mpl::integral_c_tag tag; \ Chris@16: typedef mpl::int_ type; \ Chris@16: BOOST_STATIC_CONSTANT(int, value = object_serializable); \ Chris@16: }; \ Chris@16: /**/ Chris@16: Chris@16: #if defined(BOOST_NO_CWCHAR) || defined(BOOST_NO_INTRINSIC_WCHAR_T) Chris@16: #define BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER_WCHAR(C) Chris@16: #else Chris@16: #define BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER_WCHAR(C) \ Chris@16: BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(wchar_t, C) \ Chris@16: /**/ Chris@16: #endif Chris@16: Chris@16: #if defined(BOOST_HAS_LONG_LONG) Chris@16: #define BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER_INT64(C) \ Chris@16: BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(boost::long_long_type, C) \ Chris@16: BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(boost::ulong_long_type, C) \ Chris@16: /**/ Chris@16: #else Chris@16: #define BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER_INT64(C) Chris@16: #endif Chris@16: Chris@16: #define BOOST_SERIALIZATION_COLLECTION_TRAITS(C) \ Chris@16: namespace boost { namespace serialization { \ Chris@16: BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(bool, C) \ Chris@16: BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(char, C) \ Chris@16: BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(signed char, C) \ Chris@16: BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(unsigned char, C) \ Chris@16: BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(signed int, C) \ Chris@16: BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(unsigned int, C) \ Chris@16: BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(signed long, C) \ Chris@16: BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(unsigned long, C) \ Chris@16: BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(float, C) \ Chris@16: BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(double, C) \ Chris@16: BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(unsigned short, C) \ Chris@16: BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(signed short, C) \ Chris@16: BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER_INT64(C) \ Chris@16: BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER_WCHAR(C) \ Chris@16: } } \ Chris@16: /**/ Chris@16: Chris@16: #endif // BOOST_SERIALIZATION_COLLECTION_TRAITS