diff options
author | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2014-08-15 17:06:16 -0400 |
---|---|---|
committer | Mark Benvenuto <mark.benvenuto@mongodb.com> | 2014-08-15 17:20:20 -0400 |
commit | 0d1d5016b57c59817fa0619e5cf4c6df046b28c3 (patch) | |
tree | eae9fc8b180f49dd5e3834f7238c9c9cad93cfd9 /src/third_party/boost-1.56.0/boost/serialization/split_member.hpp | |
parent | 492d97468b1121228f208489a645759b390f023e (diff) | |
download | mongo-0d1d5016b57c59817fa0619e5cf4c6df046b28c3.tar.gz |
SERVER-8994: Boost 1.56.0
Initial import of source
Libraries: algorithm array asio bind chrono config container date_time
filesystem function integer intrusive noncopyable optional
program_options random smart_ptr static_assert thread unordered utility
Diffstat (limited to 'src/third_party/boost-1.56.0/boost/serialization/split_member.hpp')
-rw-r--r-- | src/third_party/boost-1.56.0/boost/serialization/split_member.hpp | 86 |
1 files changed, 86 insertions, 0 deletions
diff --git a/src/third_party/boost-1.56.0/boost/serialization/split_member.hpp b/src/third_party/boost-1.56.0/boost/serialization/split_member.hpp new file mode 100644 index 00000000000..5f32520559e --- /dev/null +++ b/src/third_party/boost-1.56.0/boost/serialization/split_member.hpp @@ -0,0 +1,86 @@ +#ifndef BOOST_SERIALIZATION_SPLIT_MEMBER_HPP +#define BOOST_SERIALIZATION_SPLIT_MEMBER_HPP + +// MS compatible compilers support #pragma once +#if defined(_MSC_VER) +# pragma once +#endif + +/////////1/////////2/////////3/////////4/////////5/////////6/////////7/////////8 +// split_member.hpp: + +// (C) Copyright 2002 Robert Ramey - http://www.rrsd.com . +// Use, modification and distribution is subject to the Boost Software +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at +// http://www.boost.org/LICENSE_1_0.txt) + +// See http://www.boost.org for updates, documentation, and revision history. + +#include <boost/config.hpp> +#include <boost/mpl/eval_if.hpp> +#include <boost/mpl/identity.hpp> + +#include <boost/serialization/access.hpp> + +namespace boost { +namespace archive { + namespace detail { + template<class Archive> class interface_oarchive; + template<class Archive> class interface_iarchive; + } // namespace detail +} // namespace archive + +namespace serialization { +namespace detail { + + template<class Archive, class T> + struct member_saver { + static void invoke( + Archive & ar, + const T & t, + const unsigned int file_version + ){ + access::member_save(ar, t, file_version); + } + }; + + template<class Archive, class T> + struct member_loader { + static void invoke( + Archive & ar, + T & t, + const unsigned int file_version + ){ + access::member_load(ar, t, file_version); + } + }; + +} // detail + +template<class Archive, class T> +inline void split_member( + Archive & ar, T & t, const unsigned int file_version +){ + typedef typename mpl::eval_if< + typename Archive::is_saving, + mpl::identity<detail::member_saver<Archive, T> >, + mpl::identity<detail::member_loader<Archive, T> > + >::type typex; + typex::invoke(ar, t, file_version); +} + +} // namespace serialization +} // namespace boost + +// split member function serialize funcition into save/load +#define BOOST_SERIALIZATION_SPLIT_MEMBER() \ +template<class Archive> \ +void serialize( \ + Archive &ar, \ + const unsigned int file_version \ +){ \ + boost::serialization::split_member(ar, *this, file_version); \ +} \ +/**/ + +#endif // BOOST_SERIALIZATION_SPLIT_MEMBER_HPP |