Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How does Boost Serialization Versioning work?

Can someone explain to me how the versioning in Boost Serialization works. The archive version is always 10 and the class version 0. I thought that the version is automatically incremented when the archive is different then the last version. Do I have to define the version number by myself if I changed something?

<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE boost_serialization>
<boost_serialization signature="serialization::archive" version="10">
    <EventSet class_id="0" tracking_level="0" version="0">
        <Size>1</Size>
        <Event>
        ...
        </Event>
    </EventSet>
</boost_serialization>
like image 960
Akinna Avatar asked Jul 20 '26 21:07

Akinna


1 Answers

It is not described in Boost documentation but the line boost_serialization signature="serialization::archive" version="10" corresponds to the version of Boost.Archive library, it sometimes changes when new version of Boost becomes available.

As documentation explains, the line EventSet class_id="0" tracking_level="0" version="0" corresponds to the class version. You can change it in your code with a macro 'BOOST_CLASS_VERSION(EventSet, 1)'.

like image 178
Michael Simbirsky Avatar answered Jul 23 '26 06:07

Michael Simbirsky



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!