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>
12 #include <boost/mpl/bool_fwd.hpp>
14 namespace boost { namespace serialization {
16 /// the base class for serialization wrappers
18 /// wrappers need to be treated differently at various places in the serialization library,
19 /// e.g. saving of non-const wrappers has to be possible. Since partial specialization
20 // is not supported by all compilers, we derive all wrappers from wrapper_traits.
24 int Level = object_serializable,
25 int Tracking = track_never,
26 unsigned int Version = 0,
27 class ETII = extended_type_info_impl< T >
29 struct wrapper_traits :
30 public traits<T,Level,Tracking,Version,ETII,mpl::true_>
34 struct is_wrapper_impl :
36 boost::is_base_and_derived<basic_traits,T>,
44 typedef typename is_wrapper_impl<const T>::type type;
50 // A macro to define that a class is a wrapper
51 #define BOOST_CLASS_IS_WRAPPER(T) \
53 namespace serialization { \
55 struct is_wrapper_impl<const T> : boost::mpl::true_ {}; \
60 #endif //BOOST_SERIALIZATION_WRAPPER_HPP