reg_node_type.hpp
Go to the documentation of this file.00001 #if 0 // this file is obsolete, as of version 0.9.14
00002
00003 // "supermacro" code for registering a Data Node type with
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 #ifndef S11N_NODE_TYPE
00022 # error "S11N_NODE_TYPE is not set. Set it to the type you want to proxy before including this file!"
00023 #endif
00024
00025 #ifndef S11N_NODE_TYPE_NAME
00026 # error "S11N_NODE_TYPE_NAME is not set. Set it to the string form of S11N_NODE_TYPE!"
00027 #endif
00028
00029
00030 #define S11N_DEFAULT_BASE_SERIALIZER s11n::io::serializer< S11N_NODE_TYPE >
00031
00032 #define SERIALIZER_TYPE S11N_DEFAULT_BASE_SERIALIZER
00033 #define SERIALIZER_BASE S11N_DEFAULT_BASE_SERIALIZER
00034 #define SERIALIZER_ABSTRACT 1
00035 #define SERIALIZER_NAME ("s11n::io::serializer<" S11N_NODE_TYPE_NAME ">")
00036 #include <s11n.net/s11n/proxy/reg_serializer.hpp>
00037
00038 #ifndef s11n_REG_NODE_TYPE_FORCE_INSTANTIATION
00039 #define s11n_REG_NODE_TYPE_FORCE_INSTANTIATION 1
00040
00041 namespace s11n { namespace internal {
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054 template <typename NodeT>
00055 void serializer_registration_init()
00056 {
00057
00058 #define SERINST(SerT,CLNM,ALIAS) \
00059 ::s11n::io::register_serializer< SerT< NodeT > >( CLNM, ALIAS );
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070 #undef SERINST
00071 }
00072
00073 } }
00074
00075 namespace {
00076
00077
00078
00079 template <typename T>
00080 struct bogus_serializer_placeholder {
00081 static int placeholder;
00082 };
00083 }
00084
00085 #endif // s11n_REG_NODE_TYPE_FORCE_INSTANTIATION
00086
00087 namespace {
00088 int bogus_serializer_placeholder< S11N_NODE_TYPE >::placeholder =
00089 ( s11n::internal::serializer_registration_init< S11N_NODE_TYPE > (), 0 );
00090
00091 }
00092
00093
00094
00095 #undef S11N_NODE_TYPE
00096 #undef S11N_NODE_TYPE_NAME
00097 #undef S11N_DEFAULT_BASE_SERIALIZER
00098
00099 #endif