Chris@16: #ifndef BOOST_SERIALIZATION_WRAPPER_HPP Chris@16: #define BOOST_SERIALIZATION_WRAPPER_HPP Chris@16: Chris@16: // (C) Copyright 2005-2006 Matthias Troyer 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: #include Chris@16: #include Chris@16: #include Chris@16: #include Chris@16: Chris@16: namespace boost { namespace serialization { Chris@16: Chris@16: /// the base class for serialization wrappers Chris@16: /// Chris@16: /// wrappers need to be treated differently at various places in the serialization library, Chris@16: /// e.g. saving of non-const wrappers has to be possible. Since partial specialization Chris@16: // is not supported by all compilers, we derive all wrappers from wrapper_traits. Chris@16: Chris@16: template< Chris@16: class T, Chris@16: int Level = object_serializable, Chris@16: int Tracking = track_never, Chris@16: unsigned int Version = 0, Chris@16: class ETII = extended_type_info_impl< T > Chris@16: > Chris@16: struct wrapper_traits : Chris@16: public traits Chris@16: {}; Chris@16: Chris@16: template Chris@16: struct is_wrapper_impl : Chris@16: boost::mpl::eval_if< Chris@16: boost::is_base_and_derived, Chris@16: boost::mpl::true_, Chris@16: boost::mpl::false_ Chris@16: >::type Chris@16: {}; Chris@16: Chris@16: template Chris@16: struct is_wrapper { Chris@101: typedef typename is_wrapper_impl::type type; Chris@16: }; Chris@16: Chris@16: } // serialization Chris@16: } // boost Chris@16: Chris@16: // A macro to define that a class is a wrapper Chris@16: #define BOOST_CLASS_IS_WRAPPER(T) \ Chris@16: namespace boost { \ Chris@16: namespace serialization { \ Chris@16: template<> \ Chris@16: struct is_wrapper_impl : boost::mpl::true_ {}; \ Chris@16: } \ Chris@16: } \ Chris@16: /**/ Chris@16: Chris@16: #endif //BOOST_SERIALIZATION_WRAPPER_HPP