File indexing completed on 2025-01-18 09:50:36
0001
0002
0003
0004
0005
0006 #ifndef BOOST_PTR_CONTAINER_SERIALIZE_PTR_ARRAY_HPP
0007 #define BOOST_PTR_CONTAINER_SERIALIZE_PTR_ARRAY_HPP
0008
0009 #include <boost/ptr_container/detail/serialize_reversible_cont.hpp>
0010 #include <boost/ptr_container/ptr_array.hpp>
0011
0012 namespace boost
0013 {
0014
0015 namespace serialization
0016 {
0017
0018 template<class Archive, class T, std::size_t N, class CloneAllocator>
0019 void save(Archive& ar, const ptr_array<T, N, CloneAllocator>& c, unsigned int )
0020 {
0021 ptr_container_detail::save_helper(ar, c);
0022 }
0023
0024 template<class Archive, class T, std::size_t N, class CloneAllocator>
0025 void load(Archive& ar, ptr_array<T, N, CloneAllocator>& c, unsigned int )
0026 {
0027 typedef ptr_array<T, N, CloneAllocator> container_type;
0028 typedef BOOST_DEDUCED_TYPENAME container_type::size_type size_type;
0029
0030 for(size_type i = 0u; i != N; ++i)
0031 {
0032 T* p;
0033 ar >> boost::serialization::make_nvp( ptr_container_detail::item(), p );
0034 c.replace(i, p);
0035 }
0036 }
0037
0038 template<class Archive, class T, std::size_t N, class CloneAllocator>
0039 void serialize(Archive& ar, ptr_array<T, N, CloneAllocator>& c, const unsigned int version)
0040 {
0041 core::split_free(ar, c, version);
0042 }
0043
0044 }
0045 }
0046
0047 #endif