Question

My question is about program rollback and the management of archive compatibility : let's say I saved an object of type T with my program in version 10 => archive.txt. If I roll back my program to a previous version (let say 5), I'd like to check (without trying to deserialize for performance issue) if T in 1.30 has the same "BOOST_CLASS_VERSION" as the object saved in archive.txt.

In brief : is there a way to retrieve the BOOST_CLASS_VERSION of T stored in the archive ?

I read boost code, but I didn't find a "quite direct" way to do that. It seems I must get cobject_id_vector of basic_iarchive_impl, but all this stuff is private. Is their another non-intrusive way to do it ? (By non-intrusive I mean : only using the boost public stuff, or at least with a simple inheritance to get protected member of base classes?).

Thanks in advance.

Was it helpful?

Solution

Ok, maybe I posted my question too quickely : on the boost mailing list, they answered : no. But even if it was possible, it's not a sustainable manner to handle rollback and compatibility.

Indeed, even if my class T remains the same over program versions, maybe a member U of T will change : so I'll have to check all the members, and their members... versions : arf !!

Finally, we handle the issue with a program ("compatibility_checker") compiled with each version of the program : its purpose is to try loading an archive, to check the compatibility. Sometimes it's quite long, but at least, it's easy : when I rollback from 10 to 5, I check if an archive created in version 10 can be loaded in the "compatibility_checker"V5 and it tells to me if the rollback can be performed with those data.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top