00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef S11N_TEMPLATE_TYPE
00012 #error "You must define S11N_TEMPLATE_TYPE before including this file. e.g., to std::map or std::multimap."
00013 #endif
00014
00015 #ifndef S11N_TEMPLATE_TYPE_NAME
00016 #error "You must define S11N_TEMPLATE_TYPE_NAME before including this file. e.g., to \"map\" or \"multimap\"."
00017 #endif
00018
00019 #ifndef S11N_TEMPLATE_TYPE_PROXY
00020 # error "You must define S11N_TEMPLATE_TYPE_PROXY before including this file. e.g., ::s11n::map::map_serializable_proxy"
00021 #endif
00022
00023 #ifndef S11N_TEMPLATE_TYPE_DESER_PROXY
00024 # define S11N_TEMPLATE_TYPE_DESER_PROXY S11N_TEMPLATE_TYPE_PROXY
00025 #endif
00026
00027
00028
00029
00030
00031
00032
00033
00034 #ifndef S11N_TEMPLATE_TYPENAME_T1
00035 # define S11N_TEMPLATE_TYPENAME_T1 typename
00036 #endif
00037
00038 #ifndef S11N_TEMPLATE_TYPENAME_T2
00039 # define S11N_TEMPLATE_TYPENAME_T2 typename
00040 #endif
00041
00042
00043 #define S11N_TEMPLATE_TYPE_Q S11N_TEMPLATE_TYPE< T1, T2 >
00044
00045
00046 namespace s11n {
00047
00048
00049
00050
00051
00052
00053
00054 template <S11N_TEMPLATE_TYPENAME_T1 T1, S11N_TEMPLATE_TYPENAME_T2 T2>
00055 struct S11N_EXPORT_API s11n_traits < S11N_TEMPLATE_TYPE_Q >
00056 {
00057 typedef S11N_TEMPLATE_TYPE_Q serializable_type;
00058 typedef S11N_TEMPLATE_TYPE_PROXY serialize_functor;
00059 typedef S11N_TEMPLATE_TYPE_DESER_PROXY deserialize_functor;
00060 typedef ::s11n::default_cleanup_functor< S11N_TEMPLATE_TYPE_Q > cleanup_functor;
00061 typedef ::s11n::cl::object_factory<serializable_type> factory_type;
00062 static bool cl_reg_placeholder;
00063 static const std::string class_name( const serializable_type * instance_hint )
00064 {
00065 if( cl_reg_placeholder == true );
00066 return S11N_TEMPLATE_TYPE_NAME;
00067 }
00068 };
00069 template <
00070 S11N_TEMPLATE_TYPENAME_T1 T1,
00071 S11N_TEMPLATE_TYPENAME_T2 T2
00072 >
00073 bool s11n_traits<
00074 S11N_TEMPLATE_TYPE_Q
00075 >::cl_reg_placeholder = (
00076 ::s11n::cl::classloader_register_base< S11N_TEMPLATE_TYPE_Q >(S11N_TEMPLATE_TYPE_NAME),
00077 true
00078 );
00079
00080
00081 }
00082
00083
00084 #undef S11N_TEMPLATE_TYPE_Q
00085 #undef S11N_TEMPLATE_TYPE_PROXY
00086 #undef S11N_TEMPLATE_TYPE_DESER_PROXY
00087 #undef S11N_TEMPLATE_TYPE_NAME
00088 #undef S11N_TEMPLATE_TYPE
00089 #undef S11N_TEMPLATE_TYPENAME_T1
00090 #undef S11N_TEMPLATE_TYPENAME_T2