From: stephan b. <sg...@us...> - 2004-12-26 01:43:45
|
Update of /cvsroot/pclasses/pclasses2/src/s11n In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8735/src/s11n Modified Files: classload.h pods_streamable.h s11n.h test.cpp traits.h Log Message: list/vector/set/multiset de/ser working again. Index: classload.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/s11n/classload.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- classload.h 26 Dec 2004 01:26:14 -0000 1.3 +++ classload.h 26 Dec 2004 01:43:29 -0000 1.4 @@ -120,7 +120,7 @@ template <typename InterfaceType, typename SubType> void classloader_register( const std::string & classname ) { - classloader<InterfaceType>().registerRactory( + classloader<InterfaceType>().registerFactory( classname, ::P::Hook::FactoryCreateHook<InterfaceType,SubType>::create ); Index: test.cpp =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/s11n/test.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- test.cpp 26 Dec 2004 01:26:52 -0000 1.1 +++ test.cpp 26 Dec 2004 01:43:29 -0000 1.2 @@ -1,10 +1,13 @@ -#include "s11n.h" -#include "s11n_node.h" -#include "s11n_debuggering_macros.h" - +#include <pclasses/s11n/s11n.h> +#include <pclasses/s11n/s11n_node.h> +#include <pclasses/s11n/s11n_debuggering_macros.h> +#include <pclasses/s11n/list.h> +#include <pclasses/s11n/pods_streamable.h> +#include <pclasses/Util/LexT.h> #include <memory> // auto_ptr #include <cassert> +#include <list> #define NODE_TYPE ::P::s11n::s11n_node #define SERIALIZE(Node,SType,SObj) ::P::s11n::serialize< NODE_TYPE >( Node, SObj ) @@ -100,5 +103,23 @@ BAP b2 = BAP( DESERIALIZE(node,TheBase) ); assert( b2.get() && "Deserialize failed :(" ); CERR << "Deser workie!\n"; + + + TRAITS::clear(node); + + using ::P::Util::LexT; + typedef std::list<LexT> ListT; + ListT list; + for( int i = 0; i < 10; i++ ) + { + list.push_back( LexT( std::string("this is item #") + LexT(i).str() ) ); + } + assert( SERIALIZE(node,ListT,list) ); + list.clear(); + + bool worked = ::P::s11n::deserialize( node, list ); + assert( worked && "deser list failed :(" ); + CERR << "list.size() == " << list.size()<<"\n"; + return 0; } Index: traits.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/s11n/traits.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- traits.h 26 Dec 2004 00:55:20 -0000 1.2 +++ traits.h 26 Dec 2004 01:43:29 -0000 1.3 @@ -292,7 +292,7 @@ Removes all children and properties from node, freeing up their resources. */ - static void clear ( node_type & node ) + static void clear( node_type & node ) { node.clear(); } Index: s11n.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/s11n/s11n.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -d -r1.3 -r1.4 --- s11n.h 26 Dec 2004 01:26:15 -0000 1.3 +++ s11n.h 26 Dec 2004 01:43:29 -0000 1.4 @@ -11,6 +11,8 @@ // The s11n namespace docs go here so doxygen will pick them up nicely. //////////////////////////////////////////////////////////////////////// +#define PCLASSES_S11N_INCLUDED 1 + #include <string> namespace P { Index: pods_streamable.h =================================================================== RCS file: /cvsroot/pclasses/pclasses2/src/s11n/pods_streamable.h,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- pods_streamable.h 26 Dec 2004 01:26:15 -0000 1.2 +++ pods_streamable.h 26 Dec 2004 01:43:29 -0000 1.3 @@ -1,4 +1,4 @@ -#if !defined(s11n_PODS_STREAMABLE_HPP_INCLUDED) +#if !defined(p_PODS_STREAMABLE_HPP_INCLUDED) #define p_PODS_STREAMABLE_HPP_INCLUDED 1 //////////////////////////////////////////////////////////////////////// // pod.h: default POD proxies. @@ -72,4 +72,4 @@ #undef PS11N_PODS_STREAMABLE_PROXY -#endif // s11n_PODS_STREAMABLE_HPP_INCLUDED +#endif // p_PODS_STREAMABLE_HPP_INCLUDED |