Boost logo

Boost :

From: Marcin Kalicinski (kalita_at_[hidden])
Date: 2006-04-21 17:24:36


>> We currently use XML archives with serialization for this, but because
>> of class/type ids etc and other info serialization squirts out, this
>> files can easily be screwed up.
>
> Write SimpleXML Archive and submit it to include in serialization lib. It
> looks like there is a market for something like that.

I have tried to do just that, see my post copy-pasted from another part of
this thread:

<snip>

I have recently tried to do just this. Not subtracting from the great value
of serialization library, it has a nasty habit of polluting XML files it
generates with all sorts of magic id numbers that definitly are not human
editable or creatable. By creating my own archive class I was able to get
rid of most of them, but not all. Some (class-id integers and tracking-id
integers) are so inherently embedded in the library that it would require
quite an effort to hack them out.

To be able to hand-edit XML serialization files, I needed to replace
class-id integers with class names (the ones you specify to
BOOST_SERIALIZATION_EXPORT macros). Initially I thought it will be easy, but
I was wrong. Entire dynamic instantiation mechanism in serialization library
seems to depend heavily on these integer ids. It only uses names when class
is first seen, and there is not id for it yet. I then tried to use sure-fire
method ;-) , which failed as well. Briefly, I made my archive class to
generate fake class-ids from class names (in an effort to predict which id
would be expected now by serialization). It failed for reasons I cannot
recall at the moment - they had something to do with inheritance
hierarchies.

In case of tracking-ids I just wanted them out, because I do not have
duplicate objects in human-created files. On the other hand, I couldn't
disable tracking per-class, because I still wanted other archives to do
tracking on these objects. A couple of days ago I even posted a question for
Robert, and he says that I would need to create my own version of
tracking.hpp.

So as you can see it is not all roses with serialization library and human
readable files.

<snip>

Best regards,
Marcin


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk