From: <sg...@us...> - 2003-09-28 03:22:12
|
Update of /cvsroot/libfunutil/libfunutil/tests/s11n In directory sc8-pr-cvs1:/tmp/cvs-serv17332/tests/s11n Modified Files: BarClass.cpp FooClass.cpp in.sertest test.s11n.cpp Log Message: good night! Index: BarClass.cpp =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/tests/s11n/BarClass.cpp,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- BarClass.cpp 27 Sep 2003 22:36:54 -0000 1.1 +++ BarClass.cpp 28 Sep 2003 03:21:57 -0000 1.2 @@ -4,10 +4,11 @@ #include "BarClass.h" -S11N_INSTANTIATOR(BarClass); +S11N_INSTANTIATOR(,BarClass); using namespace s11n; using namespace std; + BarClass::BarClass( ) : Serializable("BarClass") Index: FooClass.cpp =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/tests/s11n/FooClass.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- FooClass.cpp 28 Sep 2003 01:35:30 -0000 1.2 +++ FooClass.cpp 28 Sep 2003 03:21:57 -0000 1.3 @@ -15,14 +15,29 @@ using namespace s11n; using namespace std; +namespace foo { + struct Baz : public foo::FooClass + { + Baz() { this->implClass( "foo::Baz" ); } + ~Baz(){} + }; + struct BarClass : public foo::FooClass + { + BarClass() { this->implClass( "foo::BarClass" ); } + ~BarClass(){} + }; + +} // namespace foo extern "C" { - void DLLLoader_bootstrap() + void DLLLoader_bootstrap( const char *key ) { typedef s11n::Factory<s11n::Serializable,foo::FooClass> Fac; - COUT << "DLLLoader_bootstrap()" << endl; - s11n::register_serializable_type<foo::FooClass>("WonderBra"); + COUT << "DLLLoader_bootstrap("<<key<<")" << endl; + s11n::register_serializable_type<foo::FooClass>("foo::WonderBra"); s11n::register_serializable_type<foo::FooClass>("foo:FooClass"); + s11n::register_serializable_type<foo::Baz>("foo::Baz"); + s11n::register_serializable_type<foo::BarClass>("foo::BarClass"); } } Index: in.sertest =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/tests/s11n/in.sertest,v retrieving revision 1.1 retrieving revision 1.2 diff -u -d -r1.1 -r1.2 --- in.sertest 27 Sep 2003 22:36:54 -0000 1.1 +++ in.sertest 28 Sep 2003 03:21:57 -0000 1.2 @@ -3,19 +3,37 @@ foo = one bar = two - foo_child class=FooClass + foo_child class=foo::FooClass { fee = fii fo = fum + } - foo_child class=FooClass + foo_child class=foo::Baz + { + fee = fii + fo = fum + } + foo_child class=foo::BarClass { fee = fii fo = fum } - foo_child class=FooClass + foo_child class=BarClass + { + fee = fii + fo = fum + } + + foo_child class=foo::FooClass + { + fee = fii + fo = fum + } + + foo_child class=foo::WonderBra { fii = fee fum = fo Index: test.s11n.cpp =================================================================== RCS file: /cvsroot/libfunutil/libfunutil/tests/s11n/test.s11n.cpp,v retrieving revision 1.2 retrieving revision 1.3 diff -u -d -r1.2 -r1.3 --- test.s11n.cpp 28 Sep 2003 01:35:30 -0000 1.2 +++ test.s11n.cpp 28 Sep 2003 03:21:57 -0000 1.3 @@ -110,12 +110,14 @@ Called by DLLLoader the first time it tries to load a class from the global space. */ - void DLLLoader_bootstrap() + void DLLLoader_bootstrap( const char *key ) { - COUT << "DLLLoader_bootstrap()" << endl; + COUT << "DLLLoader_bootstrap("<<key<<")" << endl; + s11n::register_serializable_type<fake::FakeRoot>( "fake::FakeRoot" ); -#define CLREG(clN) COUT << "Warning: faking class type for " << # clN << std::endl; \ +#define CLREG(clN) \ +COUT << "Warning: faking type for " << # clN << std::endl; \ s11n::register_serializable_type<s11n::Serializable>( # clN ); CLREG(GEVHex); @@ -134,7 +136,6 @@ args.setArgs( argc, argv ); args.describe( "-f, --file", "filename", "input filename. --file supercedes -f." ); args.describe( "-t or -x or -sx", "bool", "Select output format: FunText, FunXML, SimpleXML." ); - args.describe( "-x", "bool", "output in FunXML format." ); args.describe( "-I, --instantiate", "bool", "Try to instantiate the root node of the input file." ); if ( args.isSet( "--help" ) ) |