1
#ifndef BOOST_SERIALIZATION_WEAK_PTR_HPP
2
#define BOOST_SERIALIZATION_WEAK_PTR_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
10
// shared_ptr.hpp: serialization for boost shared pointer
12
// (C) Copyright 2004 Robert Ramey and Martin Ecker
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/weak_ptr.hpp>
20
#include <boost/serialization/shared_ptr.hpp>
23
namespace serialization{
25
template<class Archive, class T>
28
const boost::weak_ptr< T > &t,
29
const unsigned int /* file_version */
31
const boost::shared_ptr< T > sp = t.lock();
32
ar << boost::serialization::make_nvp("weak_ptr", sp);
35
template<class Archive, class T>
38
boost::weak_ptr< T > &t,
39
const unsigned int /* file_version */
41
boost::shared_ptr< T > sp;
42
ar >> boost::serialization::make_nvp("weak_ptr", sp);
46
template<class Archive, class T>
47
inline void serialize(
49
boost::weak_ptr< T > &t,
50
const unsigned int file_version
52
boost::serialization::split_free(ar, t, file_version);
55
} // namespace serialization
58
#endif // BOOST_SERIALIZATION_WEAK_PTR_HPP