Chris@16
|
1 #ifndef BOOST_SERIALIZATION_COLLECTION_TRAITS_HPP
|
Chris@16
|
2 #define BOOST_SERIALIZATION_COLLECTION_TRAITS_HPP
|
Chris@16
|
3
|
Chris@16
|
4 // MS compatible compilers support #pragma once
|
Chris@101
|
5 #if defined(_MSC_VER)
|
Chris@16
|
6 # pragma once
|
Chris@16
|
7 #endif
|
Chris@16
|
8
|
Chris@16
|
9 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
|
Chris@16
|
10 // collection_traits.hpp:
|
Chris@16
|
11
|
Chris@16
|
12 // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
|
Chris@16
|
13 // Use, modification and distribution is subject to the Boost Software
|
Chris@16
|
14 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
|
Chris@16
|
15 // http://www.boost.org/LICENSE_1_0.txt)
|
Chris@16
|
16
|
Chris@16
|
17 // See http://www.boost.org for updates, documentation, and revision history.
|
Chris@16
|
18
|
Chris@16
|
19 // This header assigns a level implemenation trait to a collection type
|
Chris@16
|
20 // for all primitives. It is needed so that archives which are meant to be
|
Chris@16
|
21 // portable don't write class information in the archive. Since, not all
|
Chris@16
|
22 // compiles recognize the same set of primitive types, the possibility
|
Chris@16
|
23 // exists for archives to be non-portable if class information for primitive
|
Chris@16
|
24 // types is included. This is addressed by the following macros.
|
Chris@16
|
25 #include <boost/config.hpp>
|
Chris@16
|
26 #include <boost/mpl/integral_c.hpp>
|
Chris@16
|
27 #include <boost/mpl/integral_c_tag.hpp>
|
Chris@16
|
28
|
Chris@16
|
29 #include <boost/cstdint.hpp>
|
Chris@16
|
30 #include <boost/integer_traits.hpp>
|
Chris@16
|
31 #include <climits> // ULONG_MAX
|
Chris@16
|
32 #include <boost/serialization/level.hpp>
|
Chris@16
|
33
|
Chris@16
|
34 #define BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(T, C) \
|
Chris@16
|
35 template<> \
|
Chris@16
|
36 struct implementation_level< C < T > > { \
|
Chris@16
|
37 typedef mpl::integral_c_tag tag; \
|
Chris@16
|
38 typedef mpl::int_<object_serializable> type; \
|
Chris@16
|
39 BOOST_STATIC_CONSTANT(int, value = object_serializable); \
|
Chris@16
|
40 }; \
|
Chris@16
|
41 /**/
|
Chris@16
|
42
|
Chris@16
|
43 #if defined(BOOST_NO_CWCHAR) || defined(BOOST_NO_INTRINSIC_WCHAR_T)
|
Chris@16
|
44 #define BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER_WCHAR(C)
|
Chris@16
|
45 #else
|
Chris@16
|
46 #define BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER_WCHAR(C) \
|
Chris@16
|
47 BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(wchar_t, C) \
|
Chris@16
|
48 /**/
|
Chris@16
|
49 #endif
|
Chris@16
|
50
|
Chris@16
|
51 #if defined(BOOST_HAS_LONG_LONG)
|
Chris@16
|
52 #define BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER_INT64(C) \
|
Chris@16
|
53 BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(boost::long_long_type, C) \
|
Chris@16
|
54 BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(boost::ulong_long_type, C) \
|
Chris@16
|
55 /**/
|
Chris@16
|
56 #else
|
Chris@16
|
57 #define BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER_INT64(C)
|
Chris@16
|
58 #endif
|
Chris@16
|
59
|
Chris@16
|
60 #define BOOST_SERIALIZATION_COLLECTION_TRAITS(C) \
|
Chris@16
|
61 namespace boost { namespace serialization { \
|
Chris@16
|
62 BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(bool, C) \
|
Chris@16
|
63 BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(char, C) \
|
Chris@16
|
64 BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(signed char, C) \
|
Chris@16
|
65 BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(unsigned char, C) \
|
Chris@16
|
66 BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(signed int, C) \
|
Chris@16
|
67 BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(unsigned int, C) \
|
Chris@16
|
68 BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(signed long, C) \
|
Chris@16
|
69 BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(unsigned long, C) \
|
Chris@16
|
70 BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(float, C) \
|
Chris@16
|
71 BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(double, C) \
|
Chris@16
|
72 BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(unsigned short, C) \
|
Chris@16
|
73 BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER(signed short, C) \
|
Chris@16
|
74 BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER_INT64(C) \
|
Chris@16
|
75 BOOST_SERIALIZATION_COLLECTION_TRAITS_HELPER_WCHAR(C) \
|
Chris@16
|
76 } } \
|
Chris@16
|
77 /**/
|
Chris@16
|
78
|
Chris@16
|
79 #endif // BOOST_SERIALIZATION_COLLECTION_TRAITS
|