1 #ifndef BOOST_SERIALIZATION_WRAPPER_HPP
2 #define BOOST_SERIALIZATION_WRAPPER_HPP
4 // (C) Copyright 2005-2006 Matthias Troyer
5 // Use, modification and distribution is subject to the Boost Software
6 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
7 // http://www.boost.org/LICENSE_1_0.txt)
9 #include <boost/serialization/traits.hpp>
10 #include <boost/type_traits/is_base_and_derived.hpp>
11 #include <boost/mpl/eval_if.hpp>
13 namespace boost
{ namespace serialization
{
15 /// the base class for serialization wrappers
17 /// wrappers need to be treated differently at various places in the serialization library,
18 /// e.g. saving of non-const wrappers has to be possible. Since partial specialization
19 // is not supported by all compilers, we derive all wrappers from wrapper_traits.
23 int Level
= object_serializable
,
24 int Tracking
= track_never
,
25 unsigned int Version
= 0,
26 class ETII
= extended_type_info_impl
< T
>
28 struct wrapper_traits
: public traits
<T
,Level
,Tracking
,Version
,ETII
,mpl::true_
>
31 /// the is_wrapper type traits class.
35 struct is_wrapper_member
37 typedef BOOST_DEDUCED_TYPENAME
T::is_wrapper type
;
46 is_base_and_derived
<basic_traits
,T
>,
47 detail::is_wrapper_member
<T
>,
52 } } // end namespace boost::serialization
54 // A macro to define that a class is a wrapper
55 #define BOOST_CLASS_IS_WRAPPER(T) \
57 namespace serialization { \
59 struct is_wrapper< T > : mpl::true_ {}; \
63 #endif //BOOST_SERIALIZATION_WRAPPER_HPP