/*! @file @id $Id: inherit_serialization.cxx 25 2009-04-23 15:10:21Z $ */ // 1 2 3 4 5 6 7 8 // 45678901234567890123456789012345678901234567890123456789012345678901234567890 #include #include #include class A: public xml::Serialize { public: int a; std::string txt; protected: void initXmlMembers() { className("a") .persist(a, "a") .persist(txt, "txt"); } }; class B: public xml::Serialize { public: int i; std::string txt; A a; protected: void initXmlMembers() { className("b") .persist(i, "i") .persist(txt, "txt") .persist(a, "a"); } }; std::ostream& fn(std::ostream& os) { os<\n" "\t1234\n" "\tDies ist Class B\n" "\t\n" "\t\t5678\n" "\t\tDies ist Class A\n" "\t" ""); B b; b.loadXml(ss); if (b.i==1234) b.i=4321; if (b.a.a==5678) b.a.a=8765; std::cout<<"Text B: "<