
On 3/15/07, Robert Ramey <ramey@rrsd.com> wrote:
Zach Laine wrote:
I did something stupid with my serialization code. I blithely changed the names of several polymorphic classes everywhere they appeared in the code, since they had moved out of a class into that class's namespace (e.g. SomeNS::View::Primitive became SomeNS::Primitive). Several months later, I discovered that I could no longer read old binary archives, because I was using Boost.Serialization's BOOST_CLASS_EXPORT() macro, and this macro was now registering the Primtive type with the name-string "Primitive", instead of "View::Primitive", which is how it was saved in the oldest archives.
Ouch.
would it be technically possible to add a BOOST_CLASS_EXPORT_ALIAS() macro, or some such? If it is possible, I'm willing to supply the implementation.
I might be possible by hacking your own copy of extended_type_info.hpp. I don't think we'd want to include such thing in the library. So I would suggest:
a) make the hack b) make small program which loads your old archives and creates new ones. This should be very easy. c) Forget this ever happened.
Why don't you want to include such a feature in the library? I'll probably go ahead and create the alias-aware patch I was talking about before, and start using the patched version of Boost until I no longer need to support the old data format. Unfortunately, I'm not in a position to reprocess all the old-format data. Zach Laine