File indexing completed on 2024-11-15 09:30:59
0001 #ifndef BOOST_SERIALIZATION_ARCHIVE_INPUT_UNORDERED_MAP_HPP
0002 #define BOOST_SERIALIZATION_ARCHIVE_INPUT_UNORDERED_MAP_HPP
0003
0004
0005 #if defined(_MSC_VER) && (_MSC_VER >= 1020)
0006 # pragma once
0007 #endif
0008
0009
0010
0011
0012
0013
0014
0015
0016
0017
0018
0019
0020
0021 #include <boost/config.hpp>
0022 #include <boost/serialization/nvp.hpp>
0023 #include <boost/serialization/detail/stack_constructor.hpp>
0024 #include <boost/serialization/utility.hpp>
0025 #include <boost/move/utility_core.hpp>
0026
0027 namespace boost {
0028 namespace serialization {
0029 namespace stl {
0030
0031
0032 template<class Archive, class Container>
0033 struct archive_input_unordered_map
0034 {
0035 inline void operator()(
0036 Archive &ar,
0037 Container &s,
0038 const unsigned int v
0039 ){
0040 typedef typename Container::value_type type;
0041 detail::stack_construct<Archive, type> t(ar, v);
0042 ar >> boost::serialization::make_nvp("item", t.reference());
0043 std::pair<typename Container::const_iterator, bool> result =
0044 s.insert(boost::move(t.reference()));
0045
0046
0047
0048 if(result.second){
0049 ar.reset_object_address(
0050 & (result.first->second),
0051 & t.reference().second
0052 );
0053 }
0054 }
0055 };
0056
0057
0058 template<class Archive, class Container>
0059 struct archive_input_unordered_multimap
0060 {
0061 inline void operator()(
0062 Archive &ar,
0063 Container &s,
0064 const unsigned int v
0065 ){
0066 typedef typename Container::value_type type;
0067 detail::stack_construct<Archive, type> t(ar, v);
0068 ar >> boost::serialization::make_nvp("item", t.reference());
0069 typename Container::const_iterator result =
0070 s.insert(t.reference());
0071
0072
0073
0074 ar.reset_object_address(
0075 & result->second,
0076 & t.reference()
0077 );
0078 }
0079 };
0080
0081 }
0082 }
0083 }
0084
0085 #endif