1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/ossrv_pub/boost_apis/boost/serialization/version.hpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,87 @@
1.4 +#ifndef BOOST_SERIALIZATION_VERSION_HPP
1.5 +#define BOOST_SERIALIZATION_VERSION_HPP
1.6 +
1.7 +// MS compatible compilers support #pragma once
1.8 +#if defined(_MSC_VER) && (_MSC_VER >= 1020)
1.9 +# pragma once
1.10 +#endif
1.11 +
1.12 +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
1.13 +// version.hpp:
1.14 +
1.15 +// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
1.16 +// Use, modification and distribution is subject to the Boost Software
1.17 +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
1.18 +// http://www.boost.org/LICENSE_1_0.txt)
1.19 +
1.20 +// See http://www.boost.org for updates, documentation, and revision history.
1.21 +
1.22 +#include <boost/config.hpp>
1.23 +#include <boost/mpl/int.hpp>
1.24 +#include <boost/mpl/eval_if.hpp>
1.25 +#include <boost/mpl/identity.hpp>
1.26 +#include <boost/mpl/integral_c_tag.hpp>
1.27 +
1.28 +#include <boost/type_traits/is_base_and_derived.hpp>
1.29 +//#include <boost/serialization/traits.hpp>
1.30 +
1.31 +namespace boost {
1.32 +namespace serialization {
1.33 +
1.34 +struct basic_traits;
1.35 +
1.36 +// default version number is 0. Override with higher version
1.37 +// when class definition changes.
1.38 +template<class T>
1.39 +struct version
1.40 +{
1.41 + template<class U>
1.42 + struct traits_class_version {
1.43 + typedef BOOST_DEDUCED_TYPENAME U::version type;
1.44 + };
1.45 +
1.46 + typedef mpl::integral_c_tag tag;
1.47 + // note: at least one compiler complained w/o the full qualification
1.48 + // on basic traits below
1.49 + typedef
1.50 + BOOST_DEDUCED_TYPENAME mpl::eval_if<
1.51 + is_base_and_derived<boost::serialization::basic_traits,T>,
1.52 + traits_class_version<T>,
1.53 + mpl::int_<0>
1.54 + >::type type;
1.55 + BOOST_STATIC_CONSTANT(unsigned int, value = version::type::value);
1.56 +};
1.57 +
1.58 +} // namespace serialization
1.59 +} // namespace boost
1.60 +
1.61 +// specify the current version number for the class
1.62 +#define BOOST_CLASS_VERSION(T, N) \
1.63 +namespace boost { \
1.64 +namespace serialization { \
1.65 +template<> \
1.66 +struct version<T > \
1.67 +{ \
1.68 + typedef mpl::int_<N> type; \
1.69 + typedef mpl::integral_c_tag tag; \
1.70 + BOOST_STATIC_CONSTANT(unsigned int, value = version::type::value); \
1.71 + /* require that class info saved when versioning is used */ \
1.72 + /* \
1.73 + BOOST_STATIC_ASSERT(( \
1.74 + mpl::or_< \
1.75 + mpl::equal_to< \
1.76 + mpl::int_<0>, \
1.77 + mpl::int_<N> \
1.78 + >, \
1.79 + mpl::equal_to< \
1.80 + implementation_level<T>, \
1.81 + mpl::int_<object_class_info> \
1.82 + > \
1.83 + >::value \
1.84 + )); \
1.85 + */ \
1.86 +}; \
1.87 +} \
1.88 +}
1.89 +
1.90 +#endif // BOOST_SERIALIZATION_VERSION_HPP