00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018 #ifndef GRAPHLAB_SERIALIZE_MAP_HPP
00019 #define GRAPHLAB_SERIALIZE_MAP_HPP
00020
00021 #include <map>
00022 #include <graphlab/serialization/iarchive.hpp>
00023 #include <graphlab/serialization/oarchive.hpp>
00024 #include <graphlab/serialization/iterator.hpp>
00025
00026 namespace graphlab {
00027
00028 namespace archive_detail {
00029
00030 template <typename ArcType, typename T, typename U>
00031 struct serialize_impl<ArcType, std::map<T,U>, false > {
00032 static void exec(ArcType& a, const std::map<T,U>& vec){
00033 serialize_iterator(a,vec.begin(),vec.end(), vec.size());
00034 }
00035 };
00036
00037
00038
00039 template <typename ArcType, typename T, typename U>
00040 struct deserialize_impl<ArcType, std::map<T,U>, false > {
00041 static void exec(ArcType& a, std::map<T,U>& vec){
00042 vec.clear();
00043 deserialize_iterator<ArcType, std::pair<T,U> >(a, std::inserter(vec,vec.end()));
00044 }
00045 };
00046
00047 }
00048 }
00049 #endif
00050