Re: [boost] Boost XML Serialization Stability across library versions
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; } 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
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
Thank you Robert. Is there a compression library that you think would be well suited for this? Regards, Adlai On 1/29/17 10:03 AM, Robert Ramey wrote:
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.
On 1/31/17 6:21 PM, Adlai Shawareb wrote:
Thank you Robert. Is there a compression library that you think would be well suited for this?
use boost.iostreams for this. The serialization library can a boost.stream so you stackup any combination of modules from there. One is a zip stream.
Regards, Adlai
On 1/29/17 10:03 AM, Robert Ramey wrote:
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.
_______________________________________________ Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
participants (2)
-
Adlai Shawareb
-
Robert Ramey