From don at andesengineering.com Fri Oct 14 10:13:24 2011 From: don at andesengineering.com (Don Burns) Date: Fri, 14 Oct 2011 10:13:24 -0700 Subject: [chaskii-users] iiXML changes Message-ID: I've checked in, recently, some changes to iiXML that will affect your XML serializer/deserializers. The change simplifies usage quite a bit, but breaks source compatibility. iiXML::Elements are not templates, allowing generic usage of the Element wrapper. The old usage was: struct MyData { .... }; class MyDataElement: public iiXML::Element { public: MyDataElement( MyData *d ):_d(d) {} virtual const char *elementName( "MyData" ); MyData *getMyData() { return _d; } private: MyData *_d; }; Your deserializer then would return iiXML::Element *deserialize( deserialize( ElementList &elements, const std::string &text ) { .... return new MyDataElement( new MyData ); } Now, you eliminate the description of your Element wrapper and use a template instead: iiXML::BaseElement *deserialize( deserialize( ElementList &elements, const std::string &text ) { .... return new iiXML::Element( new MyData ); } and access the data by dynamic_casting and calling getElement() iiXML::Element *e = dynamic_cast *>( base_element_ptr ); MyData *data = e->getElement(); -don -------------- next part -------------- An HTML attachment was scrubbed... URL: http://chaskii.org/pipermail/chaskii-users/attachments/20111014/8363fc6a/attachment.htm