Boost logo

Boost :

Subject: Re: [boost] Boost XML Serialization Stability across library versions
From: Robert Ramey (ramey_at_[hidden])
Date: 2017-01-29 13:03:20


On 1/26/17 1:20 PM, Adlai Shawareb wrote:
> Thanks Robert,
>
> Regarding your suggestion to use text serialization. Since, over time, we will be adding and deleting data from the data set that we serialize, would the following be the right approach to managing the changes in the data that is de/serialized. I'm thinking that we would set the BOOST_CLASS_VERSION before de/serializing.
>
> {
> ar & mInt;
> If(version >= 2)
> ar & mFloat;
> If(version >= 3)
> ar & mInt2;
> ar & mFloat2;
> }

This is the way that versioning is intended to be used. Note that this
verisoning is implemented for all archives types. So using XML wouldn't
add anything. I would say the only think you need to do is not use
binary archive. This might create difficulties if over the life of the
product, the compiler was upgraded. So if were me I'd use the text archive.

I've you're strapped for space, you can compress the text stream on the
fly. This makes for a small, fast, guaranteed portable archive.

I also can't stress enough that for this application, in addition to
running the serialization library test suite, you should add you're own
set of tests to test serialization on your own data types.

>
> Regards,
> Adlai
>
> On 1/25/17 12:04:00, Robert Ramey wrote:
>> Right. No one as under taken that task. Should be fairly straight
>> forward using spirit v3.
>> Robert Ramey
>
> _______________________________________________
> Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
>


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