From: Zach Laine (whatwasthataddress_at_[hidden])
Date: 2007-03-15 16:59:26
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.
Since there is a 1-1 mapping between name-strings and types, and since
most of the Serialization code uses static/global data, I cannot
currently support both the archives saved with and the archives saved
without the "View::" in the same program.
Since I suspect this is not the first time someone has done this, nor
the last time someone will do so, is there a way to fix this using the
current library? If not, 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.
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk