From: stephan b. <sg...@us...> - 2004-12-26 01:26:39
|
Update of /cvsroot/pclasses/pclasses2/src/s11n In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6787/src/s11n Modified Files: classload.h list.h Makefile.toc map.h pods_streamable.h reg_list_specializations.h reg_map_specializations.h reg_serializable_traits.h s11n.h Log Message: mass commit: it works :) Index: reg_map_specializations.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/s11n/reg_map_specializations.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- reg_map_specializations.h 26 Dec 2004 00:55:20 -0000 1.2 +++ reg_map_specializations.h 26 Dec 2004 01:26:15 -0000 1.3 @@ -1,15 +1,15 @@ // a supermacro to generate some partial template specializations for map-type classes. -#ifndef S11N_MAP_TYPE -#error "You must define S11N_MAP_TYPE before including this file. e.g., to std::map or std::multimap." +#ifndef PS11N_MAP_TYPE +#error "You must define PS11N_MAP_TYPE before including this file. e.g., to std::map or std::multimap." #endif -#ifndef S11N_MAP_TYPE_NAME -#error "You must define S11N_MAP_TYPE_NAME before including this file. e.g., to \"list\" or \"vector\"." +#ifndef PS11N_MAP_TYPE_NAME +#error "You must define PS11N_MAP_TYPE_NAME before including this file. e.g., to \"list\" or \"vector\"." #endif -#ifndef S11N_MAP_TYPE_PROXY -#define S11N_MAP_TYPE_PROXY ::P::s11n::map::map_serializable_proxy +#ifndef PS11N_MAP_TYPE_PROXY +#define PS11N_MAP_TYPE_PROXY ::P::s11n::map::map_serializable_proxy #endif namespace { // set up ::classname<>() @@ -17,19 +17,19 @@ //////////////////////////////////////////////////////////// - // S11N_MAP_TYPE + // PS11N_MAP_TYPE template <typename MapType, typename ValueType> - struct class_name< S11N_MAP_TYPE<MapType, ValueType> > + struct class_name< PS11N_MAP_TYPE<MapType, ValueType> > { - typedef S11N_MAP_TYPE<MapType, ValueType> named_type; + typedef PS11N_MAP_TYPE<MapType, ValueType> named_type; static const char * name() { static bool inited = false; if( (!inited) && (inited=true) ) { - ::P::s11n::cl::classloader_register_base< named_type >( S11N_MAP_TYPE_NAME ); + ::P::s11n::cl::classloader_register_base< named_type >( PS11N_MAP_TYPE_NAME ); } - return S11N_MAP_TYPE_NAME; + return PS11N_MAP_TYPE_NAME; } }; @@ -43,10 +43,10 @@ s11n_traits<> specialization for std::map types. */ template <typename KeyT, typename ValT> - struct s11n_traits < S11N_MAP_TYPE<KeyT,ValT> > + struct s11n_traits < PS11N_MAP_TYPE<KeyT,ValT> > { - typedef S11N_MAP_TYPE<KeyT,ValT> serializable_type; - typedef S11N_MAP_TYPE_PROXY serialize_functor; + typedef PS11N_MAP_TYPE<KeyT,ValT> serializable_type; + typedef PS11N_MAP_TYPE_PROXY serialize_functor; typedef serialize_functor deserialize_functor; typedef ::P::s11n::cl::object_factory<serializable_type> factory_type; static const bool cl_reg_placeholder = (::classname<serializable_type>(),true) ; @@ -56,6 +56,6 @@ } // namespace s11n -#undef S11N_MAP_TYPE_PROXY -#undef S11N_MAP_TYPE_NAME -#undef S11N_MAP_TYPE +#undef PS11N_MAP_TYPE_PROXY +#undef PS11N_MAP_TYPE_NAME +#undef PS11N_MAP_TYPE Index: classload.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/s11n/classload.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- classload.h 26 Dec 2004 00:55:20 -0000 1.2 +++ classload.h 26 Dec 2004 01:26:14 -0000 1.3 @@ -60,7 +60,7 @@ { try { - return ::P::Factory<InterfaceType>::instance().create( classname ); + return ::P::Factory<InterfaceType, ::P::Sharing::FactoryContext, std::string >::instance().create( classname ); } catch(...) { Index: map.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/s11n/map.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- map.h 26 Dec 2004 00:55:20 -0000 1.2 +++ map.h 26 Dec 2004 01:26:15 -0000 1.3 @@ -606,17 +606,17 @@ } } // namespace P::s11n -#define S11N_MAP_TYPE std::pair -#define S11N_MAP_TYPE_NAME "pair" -#define S11N_MAP_TYPE_PROXY ::P::s11n::map::pair_serializable_proxy +#define PS11N_MAP_TYPE std::pair +#define PS11N_MAP_TYPE_NAME "pair" +#define PS11N_MAP_TYPE_PROXY ::P::s11n::map::pair_serializable_proxy #include "reg_map_specializations.h" -#define S11N_MAP_TYPE std::map -#define S11N_MAP_TYPE_NAME "map" +#define PS11N_MAP_TYPE std::map +#define PS11N_MAP_TYPE_NAME "map" #include "reg_map_specializations.h" -#define S11N_MAP_TYPE std::multimap -#define S11N_MAP_TYPE_NAME "multimap" +#define PS11N_MAP_TYPE std::multimap +#define PS11N_MAP_TYPE_NAME "multimap" #include "reg_map_specializations.h" Index: reg_list_specializations.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/s11n/reg_list_specializations.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- reg_list_specializations.h 26 Dec 2004 00:55:20 -0000 1.2 +++ reg_list_specializations.h 26 Dec 2004 01:26:15 -0000 1.3 @@ -1,19 +1,19 @@ // a supermacro to generate some partial template specializations for list-type classes. -#ifndef S11N_LIST_TYPE -#error "You must define S11N_LIST_TYPE before including this file. e.g., to std::list or std::vector." +#ifndef PS11N_LIST_TYPE +#error "You must define PS11N_LIST_TYPE before including this file. e.g., to std::list or std::vector." #endif -#ifndef S11N_LIST_TYPE_NAME -#error "You must define S11N_LIST_TYPE_NAME before including this file. e.g., to \"list\" or \"vector\"." +#ifndef PS11N_LIST_TYPE_NAME +#error "You must define PS11N_LIST_TYPE_NAME before including this file. e.g., to \"list\" or \"vector\"." #endif -#ifndef S11N_LIST_TYPE_PROXY -#define S11N_LIST_TYPE_PROXY ::P::s11n::list::list_serializable_proxy +#ifndef PS11N_LIST_TYPE_PROXY +#define PS11N_LIST_TYPE_PROXY ::P::s11n::list::list_serializable_proxy #endif -// #ifndef S11N_LIST_REGISTRATION_FUNC_DEFINED -// # define S11N_LIST_REGISTRATION_FUNC_DEFINED 1 +// #ifndef PS11N_LIST_REGISTRATION_FUNC_DEFINED +// # define PS11N_LIST_REGISTRATION_FUNC_DEFINED 1 // namespace s11n { // namespace list { // template <typename T> @@ -25,7 +25,7 @@ // } // } // } -// #endif // S11N_LIST_REGISTRATION_FUNC_DEFINED +// #endif // PS11N_LIST_REGISTRATION_FUNC_DEFINED namespace { // set up ::classname<>() @@ -33,19 +33,19 @@ //////////////////////////////////////////////////////////// - // S11N_LIST_TYPE + // PS11N_LIST_TYPE template <typename ValueType > - struct class_name< S11N_LIST_TYPE< ValueType > > + struct class_name< PS11N_LIST_TYPE< ValueType > > { - typedef S11N_LIST_TYPE< ValueType > named_type; + typedef PS11N_LIST_TYPE< ValueType > named_type; static const char * name() { static bool inited = false; if( (!inited) && (inited=true) ) { - ::P::s11n::cl::classloader_register_base< named_type >( S11N_LIST_TYPE_NAME ); + ::P::s11n::cl::classloader_register_base< named_type >( PS11N_LIST_TYPE_NAME ); } - return S11N_LIST_TYPE_NAME; + return PS11N_LIST_TYPE_NAME; } }; @@ -60,10 +60,10 @@ s11n_traits<> specialization for std::list types. */ template <typename ValT > - struct s11n_traits < S11N_LIST_TYPE<ValT> > + struct s11n_traits < PS11N_LIST_TYPE<ValT> > { - typedef S11N_LIST_TYPE<ValT> serializable_type; - typedef S11N_LIST_TYPE_PROXY serialize_functor; + typedef PS11N_LIST_TYPE<ValT> serializable_type; + typedef PS11N_LIST_TYPE_PROXY serialize_functor; typedef serialize_functor deserialize_functor; typedef ::P::s11n::cl::object_factory<serializable_type> factory_type; static const bool cl_reg_placeholder = (::classname<serializable_type>(),true) ; @@ -71,6 +71,6 @@ } } // namespace P::s11n -#undef S11N_LIST_TYPE_PROXY -#undef S11N_LIST_TYPE_NAME -#undef S11N_LIST_TYPE +#undef PS11N_LIST_TYPE_PROXY +#undef PS11N_LIST_TYPE_NAME +#undef PS11N_LIST_TYPE Index: Makefile.toc =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/s11n/Makefile.toc,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- Makefile.toc 26 Dec 2004 00:55:20 -0000 1.2 +++ Makefile.toc 26 Dec 2004 01:26:15 -0000 1.3 @@ -51,5 +51,10 @@ libpclasses_s11n_so_VERSION = $(PACKAGE_VERSION) include $(TOC_MAKESDIR)/SHARED_LIBS.make -all: symlink-headers SHARED_LIBS +BIN_PROGRAMS = test +test_bin_OBJECTS = test.o libpclasses_s11n.so +include $(TOC_MAKESDIR)/BIN_PROGRAMS.make + +all: symlink-headers SHARED_LIBS BIN_PROGRAMS + Index: list.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/s11n/list.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- list.h 26 Dec 2004 00:55:20 -0000 1.2 +++ list.h 26 Dec 2004 01:26:15 -0000 1.3 @@ -421,20 +421,20 @@ //////////////////////////////////////////////////////////////////////// // Register proxies for std-namespace sequence containers -#define S11N_LIST_TYPE std::list -#define S11N_LIST_TYPE_NAME "list" +#define PS11N_LIST_TYPE std::list +#define PS11N_LIST_TYPE_NAME "list" #include "reg_list_specializations.h" -#define S11N_LIST_TYPE std::vector -#define S11N_LIST_TYPE_NAME "vector" +#define PS11N_LIST_TYPE std::vector +#define PS11N_LIST_TYPE_NAME "vector" #include "reg_list_specializations.h" -#define S11N_LIST_TYPE std::set -#define S11N_LIST_TYPE_NAME "set" +#define PS11N_LIST_TYPE std::set +#define PS11N_LIST_TYPE_NAME "set" #include "reg_list_specializations.h" -#define S11N_LIST_TYPE std::multiset -#define S11N_LIST_TYPE_NAME "multiset" +#define PS11N_LIST_TYPE std::multiset +#define PS11N_LIST_TYPE_NAME "multiset" #include "reg_list_specializations.h" Index: pods_streamable.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/s11n/pods_streamable.h,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- pods_streamable.h 26 Dec 2004 00:37:07 -0000 1.1 +++ pods_streamable.h 26 Dec 2004 01:26:15 -0000 1.2 @@ -20,56 +20,56 @@ #include "data_node_serialize.h" #include "data_node_functor.h" // s11n::streamable_type_serialization_proxy -#define S11N_PODS_STREAMABLE_PROXY s11n::streamable_type_serialization_proxy +#define PS11N_PODS_STREAMABLE_PROXY s11n::streamable_type_serialization_proxy -#define S11N_TYPE char -#define S11N_TYPE_NAME "char" -#define S11N_SERIALIZE_FUNCTOR S11N_PODS_STREAMABLE_PROXY +#define PS11N_TYPE char +#define PS11N_TYPE_NAME "char" +#define PS11N_SERIALIZE_FUNCTOR PS11N_PODS_STREAMABLE_PROXY #include "reg_serializable_traits.h" -#define S11N_TYPE bool -#define S11N_TYPE_NAME "bool" -#define S11N_SERIALIZE_FUNCTOR S11N_PODS_STREAMABLE_PROXY +#define PS11N_TYPE bool +#define PS11N_TYPE_NAME "bool" +#define PS11N_SERIALIZE_FUNCTOR PS11N_PODS_STREAMABLE_PROXY #include "reg_serializable_traits.h" -#define S11N_TYPE int -#define S11N_TYPE_NAME "int" -#define S11N_SERIALIZE_FUNCTOR S11N_PODS_STREAMABLE_PROXY +#define PS11N_TYPE int +#define PS11N_TYPE_NAME "int" +#define PS11N_SERIALIZE_FUNCTOR PS11N_PODS_STREAMABLE_PROXY #include "reg_serializable_traits.h" -#define S11N_TYPE size_t -#define S11N_TYPE_NAME "size_t" -#define S11N_SERIALIZE_FUNCTOR S11N_PODS_STREAMABLE_PROXY +#define PS11N_TYPE size_t +#define PS11N_TYPE_NAME "size_t" +#define PS11N_SERIALIZE_FUNCTOR PS11N_PODS_STREAMABLE_PROXY #include "reg_serializable_traits.h" -#define S11N_TYPE float -#define S11N_TYPE_NAME "float" -#define S11N_SERIALIZE_FUNCTOR S11N_PODS_STREAMABLE_PROXY +#define PS11N_TYPE float +#define PS11N_TYPE_NAME "float" +#define PS11N_SERIALIZE_FUNCTOR PS11N_PODS_STREAMABLE_PROXY #include "reg_serializable_traits.h" -#define S11N_TYPE double -#define S11N_TYPE_NAME "double" -#define S11N_SERIALIZE_FUNCTOR S11N_PODS_STREAMABLE_PROXY +#define PS11N_TYPE double +#define PS11N_TYPE_NAME "double" +#define PS11N_SERIALIZE_FUNCTOR PS11N_PODS_STREAMABLE_PROXY #include "reg_serializable_traits.h" -#define S11N_TYPE long -#define S11N_TYPE_NAME "long" -#define S11N_SERIALIZE_FUNCTOR S11N_PODS_STREAMABLE_PROXY +#define PS11N_TYPE long +#define PS11N_TYPE_NAME "long" +#define PS11N_SERIALIZE_FUNCTOR PS11N_PODS_STREAMABLE_PROXY #include "reg_serializable_traits.h" -#define S11N_TYPE ulong -#define S11N_TYPE_NAME "ulong" -#define S11N_SERIALIZE_FUNCTOR S11N_PODS_STREAMABLE_PROXY +#define PS11N_TYPE ulong +#define PS11N_TYPE_NAME "ulong" +#define PS11N_SERIALIZE_FUNCTOR PS11N_PODS_STREAMABLE_PROXY #include "reg_serializable_traits.h" -#define S11N_TYPE std::string -#define S11N_TYPE_NAME "string" -#define S11N_SERIALIZE_FUNCTOR S11N_PODS_STREAMABLE_PROXY +#define PS11N_TYPE std::string +#define PS11N_TYPE_NAME "string" +#define PS11N_SERIALIZE_FUNCTOR PS11N_PODS_STREAMABLE_PROXY #include "reg_serializable_traits.h" -#undef S11N_PODS_STREAMABLE_PROXY +#undef PS11N_PODS_STREAMABLE_PROXY #endif // s11n_PODS_STREAMABLE_HPP_INCLUDED Index: s11n.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/s11n/s11n.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- s11n.h 26 Dec 2004 00:55:20 -0000 1.2 +++ s11n.h 26 Dec 2004 01:26:15 -0000 1.3 @@ -85,9 +85,10 @@ } } // namespace P::s11n #include "classload.h" -// #include "data_node.h" // reference Data Node implementation -// #include "s11n_node.h" // Another reference Data Node implementation -// #include "data_node_algo.h" // reference NodeType implementation -// #include "data_node_serialize.h" // serialize() and friends +#include "traits.h" +#include "data_node.h" // reference Data Node implementation +#include "s11n_node.h" // Another reference Data Node implementation +#include "data_node_algo.h" // reference NodeType implementation +#include "data_node_serialize.h" // serialize() and friends #endif // p_S11N_H_INCLUDED Index: reg_serializable_traits.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/s11n/reg_serializable_traits.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- reg_serializable_traits.h 26 Dec 2004 00:55:20 -0000 1.2 +++ reg_serializable_traits.h 26 Dec 2004 01:26:15 -0000 1.3 @@ -6,31 +6,31 @@ // // Vars used by this file: // -// S11N_TYPE: type to be registered +// PS11N_TYPE: type to be registered // -// S11N_TYPE_NAME: stringified name of S11N_TYPE +// PS11N_TYPE_NAME: stringified name of PS11N_TYPE // -// S11N_BASE_TYPE: if S11N_TYPE subclasses a regisitered S11N_TYPE, +// PS11N_TYPE_INTERFACE: if PS11N_TYPE subclasses a regisitered PS11N_TYPE, // pass it here. If this is set then the rest of the following // variables need not be set, as they are inherited. // -// S11N_SERIALIZE_FUNCTOR: functor type responsible for handling calls -// to serialize<S11N_TYPE>(). Default is +// PS11N_SERIALIZE_FUNCTOR: functor type responsible for handling calls +// to serialize<PS11N_TYPE>(). Default is // s11n::default_serialize_functor, which simply calls -// S11N_TYPE::operator()( NodeT & ). +// PS11N_TYPE::operator()( NodeT & ). // -// S11N_DESERIALIZE_FUNCTOR: functor type responsible for handling calls -// to serialize(). Defaults to S11N_SERIALIZE_FUNCTOR. +// PS11N_DESERIALIZE_FUNCTOR: functor type responsible for handling calls +// to serialize(). Defaults to PS11N_SERIALIZE_FUNCTOR. // -// S11N_FACTORY_TYPE: functor which is responsible for instantiating -// objects of type S11N_TYPE. Default behaviour is to use -// s11n::cl::object_factory< S11N_BASE_TYPE >. +// PS11N_FACTORY_TYPE: functor which is responsible for instantiating +// objects of type PS11N_TYPE. Default behaviour is to use +// s11n::cl::object_factory< PS11N_TYPE_INTERFACE >. // // THINGS TO KNOW: // // - If the default factory type is NOT used, the caller is -// responsible for registering S11N_TYPE with the appropriate factory, -// using the key S11N_TYPE_NAME. +// responsible for registering PS11N_TYPE with the appropriate factory, +// using the key PS11N_TYPE_NAME. // //////////////////////////////////////////////////////////////////////// // The s11n header files are expected to have been included by the @@ -39,36 +39,36 @@ // // Sample usage: // -// #define S11N_TYPE std::map<Foo,Bar> -// #define S11N_TYPE_NAME "std::map<Foo,Bar>" +// #define PS11N_TYPE std::map<Foo,Bar> +// #define PS11N_TYPE_NAME "std::map<Foo,Bar>" // #include [this file] // // // repeat for each type: -// #define S11N_TYPE std::map<Foo *,Bar *> -// #define S11N_TYPE_NAME "std::map<Foo*,Bar*>" -// #define S11N_SERIALIZE_FUNCTOR some_functor_name +// #define PS11N_TYPE std::map<Foo *,Bar *> +// #define PS11N_TYPE_NAME "std::map<Foo*,Bar*>" +// #define PS11N_SERIALIZE_FUNCTOR some_functor_name // #include [this file] // -// If S11N_TYPE is a subtype of another Serializable, +// If PS11N_TYPE is a subtype of another Serializable, // and should be available via that base-type's classloader // (Yes, you normally WANT this) then define this macro: // -// S11N_BASE_TYPE +// PS11N_TYPE_INTERFACE // -// to the type name of S11N_TYPE's BaseType. +// to the type name of PS11N_TYPE's BaseType. // -// If S11N_BASE_TYPE is not set then the following macros +// If PS11N_TYPE_INTERFACE is not set then the following macros // are also used: // -// #define S11N_SERIALIZE_FUNCTOR some_serializer_functor -// #define S11N_DESERIALIZE_FUNCTOR some_deserializer_functor +// #define PS11N_SERIALIZE_FUNCTOR some_serializer_functor +// #define PS11N_DESERIALIZE_FUNCTOR some_deserializer_functor // -// If S11N_DESERIALIZE_FUNCTOR is defined, that is used -// as the Deserialization proxy, otherwise S11N_SERIALIZE_FUNCTOR +// If PS11N_DESERIALIZE_FUNCTOR is defined, that is used +// as the Deserialization proxy, otherwise PS11N_SERIALIZE_FUNCTOR // functor is used for both cases. // // If neither are set then ::P::s11n::default_serialize_functor -// is installed, and S11N_TYPE must conform to that proxy's +// is installed, and PS11N_TYPE must conform to that proxy's // expectations. // // After each include all of these macros are unset so that they may @@ -76,43 +76,43 @@ //////////////////////////////////////////////////////////////////////// -#ifndef S11N_TYPE -# error "S11N_TYPE must be set before including this file." +#ifndef PS11N_TYPE +# error "PS11N_TYPE must be set before including this file." #endif -#ifndef S11N_TYPE_NAME -# ifdef S11N_NAME // older convention -# define S11N_TYPE_NAME S11N_NAME -# undef S11N_NAME +#ifndef PS11N_TYPE_NAME +# ifdef PS11N_NAME // older convention +# define PS11N_TYPE_NAME PS11N_NAME +# undef PS11N_NAME # else -# error "S11N_TYPE_NAME must be set before including this file. Set it to the stringified form of S11N_TYPE." +# error "PS11N_TYPE_NAME must be set before including this file. Set it to the stringified form of PS11N_TYPE." # endif #endif -// S11N_BASE_TYPE only needs to be set when registering subtypes of an +// PS11N_TYPE_INTERFACE only needs to be set when registering subtypes of an // already-registered base type... -#ifdef S11N_BASE_TYPE -# define S11N_INHERIT 1 +#ifdef PS11N_TYPE_INTERFACE +# define PS11N_INHERIT 1 #else -# define S11N_BASE_TYPE S11N_TYPE -# define S11N_INHERIT 0 -# ifndef S11N_SERIALIZE_FUNCTOR -# define S11N_SERIALIZE_FUNCTOR ::P::s11n::default_serialize_functor +# define PS11N_TYPE_INTERFACE PS11N_TYPE +# define PS11N_INHERIT 0 +# ifndef PS11N_SERIALIZE_FUNCTOR +# define PS11N_SERIALIZE_FUNCTOR ::P::s11n::default_serialize_functor # endif -# ifndef S11N_DESERIALIZE_FUNCTOR -# define S11N_DESERIALIZE_FUNCTOR S11N_SERIALIZE_FUNCTOR +# ifndef PS11N_DESERIALIZE_FUNCTOR +# define PS11N_DESERIALIZE_FUNCTOR PS11N_SERIALIZE_FUNCTOR # endif -#endif // S11N_BASE_TYPE +#endif // PS11N_TYPE_INTERFACE -#ifndef S11N_FACTORY_TYPE +#ifndef PS11N_FACTORY_TYPE // then register a factory of our own... -# define S11N_REG_CLLITE 1 -# define S11N_FACTORY_TYPE s11n::cl::object_factory< S11N_BASE_TYPE > +# define PS11N_REG_CLLITE 1 +# define PS11N_FACTORY_TYPE ::P::s11n::cl::object_factory< PS11N_TYPE_INTERFACE > #else -# define S11N_REG_CLLITE 0 -#endif // S11N_FACTORY_TYPE +# define PS11N_REG_CLLITE 0 +#endif // PS11N_FACTORY_TYPE //////////////////////////////////////////////////////////////////////// @@ -120,65 +120,56 @@ namespace P {namespace s11n { template <> - struct s11n_traits < S11N_TYPE > -#if S11N_INHERIT - : public s11n_traits < S11N_BASE_TYPE > + struct s11n_traits < PS11N_TYPE > +#if PS11N_INHERIT + : public ::P::s11n::s11n_traits < PS11N_TYPE_INTERFACE > #endif { -#if ! S11N_INHERIT - typedef S11N_TYPE serializable_type; - typedef S11N_SERIALIZE_FUNCTOR serialize_functor; - typedef S11N_DESERIALIZE_FUNCTOR deserialize_functor; - typedef S11N_FACTORY_TYPE factory_type; -#endif // S11N_INHERIT -// #if S11N_REG_CLLITE -// static bool cl_reg_placeholder; -// #endif // S11N_REG_CLLITE +#if ! PS11N_INHERIT + typedef PS11N_TYPE serializable_type; + typedef PS11N_SERIALIZE_FUNCTOR serialize_functor; + typedef PS11N_DESERIALIZE_FUNCTOR deserialize_functor; + typedef PS11N_FACTORY_TYPE factory_type; +#endif // PS11N_INHERIT }; -// #if S11N_REG_CLLITE -// bool s11n_traits< S11N_TYPE >::cl_reg_placeholder = -// (s11n::cl::classloader_register< S11N_BASE_TYPE, S11N_TYPE >( S11N_TYPE_NAME ), -// (CERR << "registering " << S11N_TYPE_NAME << "\n"), -// true); -// #endif // S11N_REG_CLLITE } } // namespace P::s11n // end s11n_traits<> //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// -// Register the type's name with ::classname<S11N_TYPE>(). +// Register the type's name with ::classname<PS11N_TYPE>(). // This is highly unfortunate, but currently required. -#define NAME_TYPE S11N_TYPE -#define TYPE_NAME S11N_TYPE_NAME -#include <s11n.net/name_type/name_type.h> +#define NAME_TYPE PS11N_TYPE +#define TYPE_NAME PS11N_TYPE_NAME +#include "name_type.h" //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// -#if S11N_REG_CLLITE +#if PS11N_REG_CLLITE // register with default classloader... -# define CL_TYPE S11N_TYPE -# define CL_TYPE_NAME S11N_TYPE_NAME -# define CL_BASE_TYPE S11N_BASE_TYPE -# ifdef S11N_ABSTRACT_BASE -# define CL_ABSTRACT_BASE 1 +# define PFACREG_TYPE PS11N_TYPE +# define PFACREG_TYPE_NAME PS11N_TYPE_NAME +# define PFACREG_TYPE_INTERFACE PS11N_TYPE_INTERFACE +# ifdef PS11N_TYPE_IS_ABSTRACT +# define PFACREG_TYPE_IS_ABSTRACT 1 # endif -# include <s11n.net/cl/cllite_reg.h> -#endif // S11N_REG_CLLITE +# include <pclasses/FactoryReg.h> +#endif // PS11N_REG_CLLITE //////////////////////////////////////////////////////////////////////// //////////////////////////////////////////////////////////////////////// // clean up for the next #include ... -#undef S11N_TYPE -#undef S11N_TYPE_NAME -#undef S11N_BASE_TYPE -#undef S11N_SERIALIZE_FUNCTOR -#undef S11N_DESERIALIZE_FUNCTOR -#undef S11N_FACTORY_TYPE -#undef S11N_INHERIT -#undef S11N_REG_CLLITE -#ifdef S11N_ABSTRACT_BASE -# undef S11N_ABSTRACT_BASE +#undef PS11N_TYPE +#undef PS11N_TYPE_NAME +#undef PS11N_TYPE_INTERFACE +#undef PS11N_SERIALIZE_FUNCTOR +#undef PS11N_DESERIALIZE_FUNCTOR +#undef PS11N_FACTORY_TYPE +#undef PS11N_INHERIT +#undef PS11N_REG_CLLITE +#ifdef PS11N_TYPE_IS_ABSTRACT +# undef PS11N_TYPE_IS_ABSTRACT #endif |