00001
00002
00003
00004
00005
00006 #ifndef S11N_MAP_TYPE
00007 #error "You must define S11N_MAP_TYPE before including this file. e.g., to std::map or std::multimap."
00008 #endif
00009
00010 #ifndef S11N_MAP_TYPE_NAME
00011 #error "You must define S11N_MAP_TYPE_NAME before including this file. e.g., to \"map\" or \"multimap\"."
00012 #endif
00013
00014 #ifndef S11N_MAP_TYPE_PROXY
00015 #define S11N_MAP_TYPE_PROXY ::s11n::map::serialize_map_f
00016
00017 #endif
00018
00019 #ifndef S11N_MAP_TYPE_DESER_PROXY
00020 # define S11N_MAP_TYPE_DESER_PROXY ::s11n::map::deserialize_map_f
00021 #endif
00022
00023 #include <s11n.net/s11n/s11n_debuggering_macros.hpp>
00024
00025 namespace s11n {
00026
00027
00028
00029
00030
00031 template <typename T1, typename T2>
00032 struct S11N_EXPORT_API default_cleanup_functor< S11N_MAP_TYPE<T1,T2> >
00033 {
00034 typedef S11N_MAP_TYPE<T1,T2> serializable_type;
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045 void operator()( serializable_type & p ) const throw()
00046 {
00047 using namespace ::s11n::debug;
00048 S11N_TRACE(TRACE_CLEANUP) << "default_cleanup_functor<> specialization cleaning up map<>...\n";
00049
00050
00051
00052
00053
00054 typedef typename serializable_type::mapped_type MT;
00055 typedef typename ::s11n::type_traits<MT>::type mapped_type;
00056 typedef typename serializable_type::iterator MIT;
00057 MIT b = p.begin();
00058 MIT e = p.end();
00059 for( ; e != b; ++b )
00060 {
00061 ::s11n::cleanup_serializable<mapped_type>( (*b).second );
00062 }
00063 p.clear();
00064 }
00065 };
00066 }
00067
00068 #define S11N_TEMPLATE_TYPE S11N_MAP_TYPE
00069 #define S11N_TEMPLATE_TYPE_NAME S11N_MAP_TYPE_NAME
00070 #define S11N_TEMPLATE_TYPE_PROXY S11N_MAP_TYPE_PROXY
00071 #define S11N_TEMPLATE_TYPE_DESER_PROXY S11N_MAP_TYPE_DESER_PROXY
00072 #include <s11n.net/s11n/proxy/reg_s11n_traits_template2.hpp>
00073 #undef S11N_MAP_TYPE_DESER_PROXY
00074 #undef S11N_MAP_TYPE_PROXY
00075 #undef S11N_MAP_TYPE_NAME
00076 #undef S11N_MAP_TYPE