/*! @file @id $Id$ */ // 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 A { // A inherits xml::Serialize, B inherits A public: int b; protected: void initXmlMembers() { A::initXmlMembers(); // <- Here is the important difference className("B"); persist(b, "b"); } }; int main(int, char**) { std::stringstream ss("\n" "\t1234\n" "\t5678\n" "\tDies ist ein Serialisierungs-Test\n" ""); B b; b.loadXml(ss); if (b.b==1234) b.b=4321; if (b.a==5678) b.a=8765; b.saveXml(std::cout)<