Back to home page

EIC code displayed by LXR

 
 

    


File indexing completed on 2025-12-16 10:08:46

0001 #ifndef BOOST_SERIALIZATION_WRAPPER_HPP
0002 #define BOOST_SERIALIZATION_WRAPPER_HPP
0003 
0004 // (C) Copyright 2005-2006 Matthias Troyer
0005 // Use, modification and distribution is subject to the Boost Software
0006 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0007 // http://www.boost.org/LICENSE_1_0.txt)
0008 
0009 #include <boost/serialization/traits.hpp>
0010 #include <boost/type_traits/is_base_and_derived.hpp>
0011 #include <boost/mpl/eval_if.hpp>
0012 #include <boost/mpl/bool_fwd.hpp>
0013 
0014 namespace boost { namespace serialization {
0015 
0016 /// the base class for serialization wrappers
0017 ///
0018 /// wrappers need to be treated differently at various places in the serialization library,
0019 /// e.g. saving of non-const wrappers has to be possible. Since partial specialization
0020 // is not supported by all compilers, we derive all wrappers from wrapper_traits.
0021 
0022 template<
0023     class T,
0024     int Level = object_serializable,
0025     int Tracking = track_never,
0026     unsigned int Version = 0,
0027     class ETII = extended_type_info_impl< T >
0028 >
0029 struct wrapper_traits :
0030     public traits<T,Level,Tracking,Version,ETII,mpl::true_>
0031 {};
0032 
0033 template<class T>
0034 struct is_wrapper_impl :
0035     boost::mpl::eval_if<
0036       boost::is_base_and_derived<basic_traits,T>,
0037       boost::mpl::true_,
0038       boost::mpl::false_
0039     >::type
0040 {};
0041 
0042 template<class T>
0043 struct is_wrapper {
0044     typedef typename is_wrapper_impl<const T>::type type;
0045 };
0046 
0047 } // serialization
0048 } // boost
0049 
0050 // A macro to define that a class is a wrapper
0051 #define BOOST_CLASS_IS_WRAPPER(T)                       \
0052 namespace boost {                                       \
0053 namespace serialization {                               \
0054 template<>                                              \
0055 struct is_wrapper_impl<const T> : boost::mpl::true_ {}; \
0056 }                                                       \
0057 }                                                       \
0058 /**/
0059 
0060 #endif //BOOST_SERIALIZATION_WRAPPER_HPP