<HTML dir=ltr><HEAD><TITLE>RE: [GCC-XML] Xrtti.h</TITLE>
<META http-equiv=Content-Type content="text/html; charset=unicode">
<META content="MSHTML 6.00.2800.1561" name=GENERATOR></HEAD>
<BODY>
<DIV id=idOWAReplyText11758 dir=ltr>
<DIV dir=ltr><FONT size=2>> BTW, I have been thinking on working on the C++ object serialization of<BR>> data as well. In my case the specification would be in the XSD.<BR><BR>Yes, there is considerable interest I think in serializing C++ objects to<BR>XML.  I personally have no interest in XML and prefer compact binary<BR>formats.  There already exist some projects to do C++ serialization into<BR>XML (and other formats), such as Boost::Serialization, and s11n.  But<BR>these all require that the developer essentially implement serialization<BR>manually for each class using macros provided by the tool.<BR><BR>As you have probably already decided for yourself, it would be much nicer<BR>if a tool took care of all of this for you, so that there is no effort<BR>needed on the part of the programmer (aside from running an extra program<BR>during build time) to have serialization of C++ objects.<BR><BR>[Shiva]</FONT></DIV>
<DIV dir=ltr><FONT size=2>**</FONT></DIV>
<DIV dir=ltr><FONT size=2> I may have not been clear earlier. XSD definitions would be used to only provide </FONT></DIV>
<DIV dir=ltr><FONT size=2>data type declarations. This the main entry point. The generated code would contain C++ </FONT></DIV>
<DIV dir=ltr><FONT size=2>classes </FONT><FONT size=2>and </FONT><FONT size=2>provide serialization in binary form for efficiency reasons.</FONT></DIV>
<DIV dir=ltr><FONT size=2></FONT> </DIV>
<DIV dir=ltr><FONT size=2>As you correctly intrepeted, I would have the generated code to mostly reflect </FONT></DIV>
<DIV dir=ltr><FONT size=2>Boost::Serialization framework though actually use boost code.</FONT></DIV>
<DIV dir=ltr><FONT size=2></FONT> </DIV>
<DIV dir=ltr><FONT size=2>My motivation to use XSD is to be used for documentation as well. This would also</FONT></DIV>
<DIV dir=ltr><FONT size=2>refer as a interface spec for syseng/developmenttools/testing/ etc.</FONT></DIV>
<DIV dir=ltr><FONT size=2></FONT> </DIV>
<DIV dir=ltr><FONT size=2>Our differences as far as I undersand.</FONT></DIV>
<DIV dir=ltr><FONT size=2></FONT> </DIV>
<DIV dir=ltr><FONT size=2>Your scheme,</FONT></DIV>
<DIV dir=ltr><FONT size=2>1. Define CPP_Interface through class definitions and using basic types.</FONT></DIV>
<DIV dir=ltr><FONT size=2>2. Use GCCXML to generate CPP_Interface_XML</FONT></DIV>
<DIV dir=ltr><FONT size=2>3. Use CPP_Interface_XML to generate serialization code.</FONT></DIV>
<DIV dir=ltr><FONT size=2></FONT> </DIV>
<DIV dir=ltr><FONT size=2>My scheme,</FONT></DIV>
<DIV dir=ltr><FONT size=2>1. Define Basic Types and User Defined types in XSD.</FONT></DIV>
<DIV dir=ltr><FONT size=2>2. a.  A parser would understand and generate the CPP or Python or Perl classes for class declarations</FONT></DIV>
<DIV dir=ltr><FONT size=2>    b. The parser would also generate Serialization methods which will be say in binary form.</FONT></DIV>
<DIV dir=ltr><FONT size=2></FONT> </DIV>
<DIV dir=ltr><FONT size=2>I understand with your dislike of XML for serialization output, but I see no reason why C++ class</FONT></DIV>
<DIV dir=ltr><FONT size=2>would win over XSD for interface specification.</FONT></DIV>
<DIV dir=ltr><FONT size=2></FONT> </DIV>
<DIV dir=ltr><FONT size=2>Infact, in your scheme XML is indeed in one of the steps before feeding to your code generator.</FONT></DIV>
<DIV dir=ltr><FONT size=2></FONT> </DIV>
<DIV dir=ltr><FONT size=2>I also had much debate to seperate the data classes with serialization methods for layering code.</FONT></DIV>
<DIV dir=ltr><FONT size=2></FONT> </DIV>
<DIV dir=ltr><FONT size=2>I do have one trick problem with defining interface, how do you handle conditional definitions?</FONT></DIV>
<DIV dir=ltr><FONT size=2></FONT> </DIV>
<DIV dir=ltr><FONT size=2>In example,</FONT></DIV>
<DIV dir=ltr><FONT size=2>class response</FONT></DIV>
<DIV dir=ltr><FONT size=2>{</FONT></DIV>
<DIV dir=ltr><FONT size=2>        bool status;</FONT></DIV>
<DIV dir=ltr><FONT size=2>         UserDefinedTypeSuccessRecord record;</FONT></DIV>
<DIV dir=ltr><FONT size=2>}</FONT></DIV>
<DIV dir=ltr><FONT size=2>If we want to define UserDefinedTypeSuccessRecord is valid or serialized only if status is set to true.</FONT></DIV>
<DIV dir=ltr><FONT size=2></FONT> </DIV>
<DIV dir=ltr><FONT size=2>I had not thought about to combine your C++ Reflection library with Serialization framework, </FONT></DIV>
<DIV dir=ltr><FONT size=2>though I see why not.</FONT></DIV>
<DIV dir=ltr><FONT size=2></FONT> </DIV>
<DIV dir=ltr><FONT size=2>We can continue the conversation in private if we are boring the rest of the group :-) My id is <A href="mailto:shiva@qualcomm.com">shiva@qualcomm.com</A></FONT></DIV>
<DIV dir=ltr><FONT size=2></FONT> </DIV>
<DIV dir=ltr><FONT size=2>**</FONT></DIV>
<DIV dir=ltr><FONT size=2></FONT> </DIV>
<DIV dir=ltr><FONT size=2></FONT> </DIV></DIV></BODY></HTML>