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