1 #ifndef BOOST_SERIALIZATION_SPLIT_MEMBER_HPP
2 #define BOOST_SERIALIZATION_SPLIT_MEMBER_HPP
4 // MS compatible compilers support #pragma once
5 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
9 /////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8
12 // (C) Copyright 2002 Robert Ramey - http://www.rrsd.com .
13 // Use, modification and distribution is subject to the Boost Software
14 // License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
15 // http://www.boost.org/LICENSE_1_0.txt)
17 // See http://www.boost.org for updates, documentation, and revision history.
19 #include <boost/config.hpp>
20 #include <boost/mpl/eval_if.hpp>
21 #include <boost/mpl/identity.hpp>
23 #include <boost/serialization/access.hpp>
28 template<class Archive> class interface_oarchive;
29 template<class Archive> class interface_iarchive;
31 } // namespace archive
33 namespace serialization {
36 template<class Archive, class T>
41 const unsigned int file_version
43 access::member_save(ar, t, file_version);
47 template<class Archive, class T>
48 struct member_loader {
52 const unsigned int file_version
54 access::member_load(ar, t, file_version);
60 template<class Archive, class T>
61 inline void split_member(
62 Archive & ar, T & t, const unsigned int file_version
64 typedef BOOST_DEDUCED_TYPENAME mpl::eval_if<
65 BOOST_DEDUCED_TYPENAME Archive::is_saving,
66 mpl::identity<detail::member_saver<Archive, T> >,
67 mpl::identity<detail::member_loader<Archive, T> >
69 typex::invoke(ar, t, file_version);
72 } // namespace serialization
75 // split member function serialize funcition into save/load
76 #define BOOST_SERIALIZATION_SPLIT_MEMBER() \
77 template<class Archive> \
80 const unsigned int file_version \
82 boost::serialization::split_member(ar, *this, file_version); \
86 #endif // BOOST_SERIALIZATION_SPLIT_MEMBER_HPP