os/ossrv/ossrv_pub/boost_apis/boost/serialization/scoped_ptr.hpp
changeset 0 bde4ae8d615e
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/os/ossrv/ossrv_pub/boost_apis/boost/serialization/scoped_ptr.hpp	Fri Jun 15 03:10:57 2012 +0200
     1.3 @@ -0,0 +1,58 @@
     1.4 +#ifndef BOOST_SERIALIZATION_SCOPED_PTR_HPP_VP_2003_10_30
     1.5 +#define BOOST_SERIALIZATION_SCOPED_PTR_HPP_VP_2003_10_30
     1.6 +
     1.7 +#if defined(_MSC_VER) && (_MSC_VER >= 1020)
     1.8 +# pragma once
     1.9 +#endif
    1.10 +
    1.11 +//  Copyright (c) 2003 Vladimir Prus.
    1.12 +// Use, modification and distribution is subject to the Boost Software
    1.13 +// License, Version 1.0. (See accompanying file LICENSE_1_0.txt or copy at
    1.14 +// http://www.boost.org/LICENSE_1_0.txt)
    1.15 +
    1.16 +// Provides non-intrusive serialization for boost::scoped_ptr
    1.17 +// Does not allow to serialize scoped_ptr's to builtin types.
    1.18 +
    1.19 +#include <boost/config.hpp>
    1.20 +
    1.21 +#include <boost/scoped_ptr.hpp>
    1.22 +#include <boost/serialization/nvp.hpp>
    1.23 +#include <boost/serialization/split_free.hpp>
    1.24 +
    1.25 +namespace boost { 
    1.26 +namespace serialization {
    1.27 +    
    1.28 +    template<class Archive, class T>
    1.29 +    void save(
    1.30 +        Archive & ar, 
    1.31 +        const boost::scoped_ptr<T> & t, 
    1.32 +        const unsigned int /* version */
    1.33 +    ){
    1.34 +        T* r = t.get();
    1.35 +        ar << boost::serialization::make_nvp("scoped_ptr", r);
    1.36 +    }
    1.37 +
    1.38 +    template<class Archive, class T>
    1.39 +    void load(
    1.40 +        Archive & ar, 
    1.41 +        boost::scoped_ptr<T> & t, 
    1.42 +        const unsigned int /* version */
    1.43 +    ){
    1.44 +        T* r;
    1.45 +        ar >> boost::serialization::make_nvp("scoped_ptr", r);
    1.46 +        t.reset(r); 
    1.47 +    }
    1.48 +
    1.49 +    template<class Archive, class T>
    1.50 +    void serialize(
    1.51 +        Archive& ar, 
    1.52 +        boost::scoped_ptr<T>& t, 
    1.53 +        const unsigned int version
    1.54 +    ){
    1.55 +        boost::serialization::split_free(ar, t, version);
    1.56 +    }
    1.57 +
    1.58 +} // namespace serialization
    1.59 +} // namespace boost
    1.60 +
    1.61 +#endif // BOOST_SERIALIZATION_SCOPED_PTR_HPP_VP_2003_10_30