1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/os/ossrv/ossrv_pub/boost_apis/boost/serialization/weak_ptr.hpp Fri Jun 15 03:10:57 2012 +0200
1.3 @@ -0,0 +1,58 @@
1.4 +#ifndef BOOST_SERIALIZATION_WEAK_PTR_HPP
1.5 +#define BOOST_SERIALIZATION_WEAK_PTR_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 +// shared_ptr.hpp: serialization for boost shared pointer
1.14 +
1.15 +// (C) Copyright 2004 Robert Ramey and Martin Ecker
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/weak_ptr.hpp>
1.23 +#include <boost/serialization/shared_ptr.hpp>
1.24 +
1.25 +namespace boost {
1.26 +namespace serialization{
1.27 +
1.28 +template<class Archive, class T>
1.29 +inline void save(
1.30 + Archive & ar,
1.31 + const boost::weak_ptr<T> &t,
1.32 + const unsigned int /* file_version */
1.33 +){
1.34 + const boost::shared_ptr<T> sp(t);
1.35 + ar << boost::serialization::make_nvp(NULL, sp);
1.36 +}
1.37 +
1.38 +template<class Archive, class T>
1.39 +inline void load(
1.40 + Archive & ar,
1.41 + boost::weak_ptr<T> &t,
1.42 + const unsigned int /* file_version */
1.43 +){
1.44 + boost::shared_ptr<T> sp;
1.45 + ar >> boost::serialization::make_nvp(NULL, sp);
1.46 + t = sp;
1.47 +}
1.48 +
1.49 +template<class Archive, class T>
1.50 +inline void serialize(
1.51 + Archive & ar,
1.52 + boost::weak_ptr<T> &t,
1.53 + const unsigned int file_version
1.54 +){
1.55 + boost::serialization::split_free(ar, t, file_version);
1.56 +}
1.57 +
1.58 +} // namespace serialization
1.59 +} // namespace boost
1.60 +
1.61 +#endif // BOOST_SERIALIZATION_WEAK_PTR_HPP