Back to home page

EIC code displayed by LXR

 
 

    


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

0001 #ifndef BOOST_SERIALIZATION_SPLIT_MEMBER_HPP
0002 #define BOOST_SERIALIZATION_SPLIT_MEMBER_HPP
0003 
0004 // MS compatible compilers support #pragma once
0005 #if defined(_MSC_VER)
0006 # pragma once
0007 #endif
0008 
0009 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
0010 // split_member.hpp:
0011 
0012 // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
0013 // Use, modification and distribution is subject to the Boost Software
0014 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
0015 // http://www.boost.org/LICENSE_1_0.txt)
0016 
0017 //  See http://www.boost.org for updates, documentation, and revision history.
0018 
0019 #include <boost/config.hpp>
0020 #include <boost/mpl/eval_if.hpp>
0021 #include <boost/mpl/identity.hpp>
0022 
0023 #include <boost/serialization/access.hpp>
0024 
0025 namespace boost {
0026 namespace archive {
0027     namespace detail {
0028         template<class Archive> class interface_oarchive;
0029         template<class Archive> class interface_iarchive;
0030     } // namespace detail
0031 } // namespace archive
0032 
0033 namespace serialization {
0034 namespace detail {
0035 
0036     template<class Archive, class T>
0037     struct member_saver {
0038         static void invoke(
0039             Archive & ar,
0040             const T & t,
0041             const unsigned int file_version
0042         ){
0043             access::member_save(ar, t, file_version);
0044         }
0045     };
0046 
0047     template<class Archive, class T>
0048     struct member_loader {
0049         static void invoke(
0050             Archive & ar,
0051             T & t,
0052             const unsigned int file_version
0053         ){
0054             access::member_load(ar, t, file_version);
0055         }
0056     };
0057 
0058 } // detail
0059 
0060 template<class Archive, class T>
0061 inline void split_member(
0062     Archive & ar, T & t, const unsigned int file_version
0063 ){
0064     typedef typename mpl::eval_if<
0065         typename Archive::is_saving,
0066         mpl::identity<detail::member_saver<Archive, T> >,
0067         mpl::identity<detail::member_loader<Archive, T> >
0068     >::type typex;
0069     typex::invoke(ar, t, file_version);
0070 }
0071 
0072 } // namespace serialization
0073 } // namespace boost
0074 
0075 // split member function serialize function into save/load
0076 #define BOOST_SERIALIZATION_SPLIT_MEMBER()                       \
0077 template<class Archive>                                          \
0078 void serialize(                                                  \
0079     Archive &ar,                                                 \
0080     const unsigned int file_version                              \
0081 ){                                                               \
0082     boost::serialization::split_member(ar, *this, file_version); \
0083 }                                                                \
0084 /**/
0085 
0086 #endif // BOOST_SERIALIZATION_SPLIT_MEMBER_HPP