Update of /cvsroot/pclasses/pclasses2/src/s11n In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31467/src/s11n Modified Files: Makefile.toc classload.h reg_list_specializations.h reg_map_specializations.h reg_serializable_traits.h traits.h valarray.h Log Message: mass commit: more P-port changes. Index: reg_map_specializations.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/s11n/reg_map_specializations.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- reg_map_specializations.h 26 Dec 2004 01:54:34 -0000 1.4 +++ reg_map_specializations.h 26 Dec 2004 04:09:28 -0000 1.5 @@ -49,7 +49,7 @@ 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; + typedef ::P::s11n::cl::factory_create_functor<serializable_type> factory_type; static const bool cl_reg_placeholder = (::classname<serializable_type>(),true) ; }; Index: classload.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/s11n/classload.h,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- classload.h 26 Dec 2004 01:43:29 -0000 1.4 +++ classload.h 26 Dec 2004 04:09:28 -0000 1.5 @@ -2,7 +2,7 @@ #define p_s11n_cl_S11N_CLASSLOAD_HPP_INCLUDED 1 #include <pclasses/Factory.h> // default classloader/factory implementation. - +#include <pclasses/Plugin/Plugin.h> namespace P { namespace s11n { @@ -13,12 +13,8 @@ Note that the registration functions in this namespace register with the cllite framework. Clients wishing to use - their own factories must: - - - register with their appropriate classloader. - - - specialize the object_factory class template so that it - forwards calls to their classloader. + their own factories must register with their appropriate + classloader. This layer is used for classloading anything which s11n @@ -36,16 +32,11 @@ namespace cl { /** - A default object factory implementation for use - with the s11n::cl::classload()-related functions. - - Clients may specialize this to return objects from - their own factories. By default it uses the cllite - framework and thus can load any type registered with - cllite's InterfaceType classloader. + A functor which passes on calls to + P::PluginManager<InterfaceType>. */ template <typename InterfaceType> - struct object_factory + struct factory_create_functor { /** Same as InterfaceType. */ typedef InterfaceType base_type; @@ -60,7 +51,7 @@ { try { - return ::P::Factory<InterfaceType, ::P::Sharing::FactoryContext, std::string >::instance().create( classname ); + return ::P::Plugin::pluginManager<InterfaceType>().create( classname ); } catch(...) { @@ -72,26 +63,16 @@ /** Returns InterfaceT's classloader. - See cllite::classloader() for important info. - - Before mucking with this object, please be aware of - the cllite relationship between it and the default - object_factory<InterfaceT> implementation (e.g., by looking - at the s11n::cl source code). - - Using this classloader for types which have - customized, non-cllite-based object_factory<InterfaceT> - specializations is essentially useless. */ template <typename InterfaceT> - ::P::Factory<InterfaceT> & + ::P::Plugin::PluginManager<InterfaceT> & classloader() { - return ::P::Factory<InterfaceT>::instance(); + return ::P::Plugin::pluginManager<InterfaceT>(); } /** - Returns object_factory<InterfaceType>()( key ). + Returns classloader<InterfaceType>().create( key ). Note that calling this function is NOT the same as @@ -102,7 +83,7 @@ template <typename InterfaceType> InterfaceType * classload( const std::string key ) { - return object_factory<InterfaceType>()( key ); + return classloader<InterfaceType>().create( key ); } /** Index: valarray.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/s11n/valarray.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- valarray.h 26 Dec 2004 00:55:20 -0000 1.2 +++ valarray.h 26 Dec 2004 04:09:28 -0000 1.3 @@ -134,7 +134,7 @@ typedef std::valarray<ValueType> serializable_type; typedef ::P::s11n::va::valarray_serializable_proxy serialize_functor; typedef serialize_functor deserialize_functor; - typedef ::P::s11n::cl::object_factory<serializable_type> factory_type; + typedef ::P::s11n::cl::factory_create_functor<serializable_type> factory_type; }; Index: traits.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/s11n/traits.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- traits.h 26 Dec 2004 01:43:29 -0000 1.3 +++ traits.h 26 Dec 2004 04:09:28 -0000 1.4 @@ -349,7 +349,7 @@ registered via the s11n::cl::classload() family of functions. */ - typedef ::P::s11n::cl::object_factory<serializable_type> factory_type; + typedef ::P::s11n::cl::factory_create_functor<serializable_type> factory_type; /** Functor type implementing serialize code. Index: reg_list_specializations.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/s11n/reg_list_specializations.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- reg_list_specializations.h 26 Dec 2004 01:26:15 -0000 1.3 +++ reg_list_specializations.h 26 Dec 2004 04:09:28 -0000 1.4 @@ -65,7 +65,7 @@ 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; + typedef ::P::s11n::cl::factory_create_functor<serializable_type> factory_type; static const bool cl_reg_placeholder = (::classname<serializable_type>(),true) ; }; Index: Makefile.toc =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/s11n/Makefile.toc,v retrieving revision 1.4 retrieving revision 1.5 diff -u -d -r1.4 -r1.5 --- Makefile.toc 26 Dec 2004 02:28:13 -0000 1.4 +++ Makefile.toc 26 Dec 2004 04:09:28 -0000 1.5 @@ -2,10 +2,13 @@ include toc.make +SUBDIRS = io + SOURCES = \ data_node.cpp \ s11n.cpp \ - s11n_node.cpp + s11n_node.cpp \ + string_util.cpp HEADERS = $(wildcard *.h) @@ -14,6 +17,7 @@ data_node \ s11n \ s11n_node \ + string_util \ ) objects: $(OBJECTS) @@ -27,8 +31,20 @@ SYMLINK_HEADERS_DEST = $(top_srcdir)/include/pclasses/s11n include $(TOC_MAKESDIR)/SYMLINK_HEADERS.make +SUBDIR_OBJECTS = io/data_node_io.o +ifeq (1,$(PCLASSES_HAVE_LIBEXPAT)) + SUBDIR_OBJECTS += io/expat/expat_serializer.o +endif + + +# odd: always causes the .o to be rebuilt: +# io/data_node_io.o: subdir-io +# io/expat/expat_serializer.o: subdir-io + + SHARED_LIBS = libpclasses_s11n -libpclasses_s11n_so_OBJECTS = $(OBJECTS) +libpclasses_s11n_so_LDADD = $(LIBEXPAT_CLIENT_LDADD) +libpclasses_s11n_so_OBJECTS = $(OBJECTS) $(SUBDIR_OBJECTS) libpclasses_s11n_so_VERSION = $(PACKAGE_VERSION) include $(TOC_MAKESDIR)/SHARED_LIBS.make @@ -36,7 +52,7 @@ test_bin_OBJECTS = test.o libpclasses_s11n.so include $(TOC_MAKESDIR)/BIN_PROGRAMS.make -all: symlink-headers SHARED_LIBS +all: symlink-headers subdirs SHARED_LIBS # BIN_PROGRAMS Index: reg_serializable_traits.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/s11n/reg_serializable_traits.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- reg_serializable_traits.h 26 Dec 2004 01:26:15 -0000 1.3 +++ reg_serializable_traits.h 26 Dec 2004 04:09:28 -0000 1.4 @@ -24,7 +24,7 @@ // // 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 >. +// s11n::cl::factory_create_functor< PS11N_TYPE_INTERFACE >. // // THINGS TO KNOW: // @@ -109,7 +109,7 @@ #ifndef PS11N_FACTORY_TYPE // then register a factory of our own... # define PS11N_REG_CLLITE 1 -# define PS11N_FACTORY_TYPE ::P::s11n::cl::object_factory< PS11N_TYPE_INTERFACE > +# define PS11N_FACTORY_TYPE ::P::s11n::cl::factory_create_functor< PS11N_TYPE_INTERFACE > #else # define PS11N_REG_CLLITE 0 #endif // PS11N_FACTORY_TYPE |