Boost logo

Boost Users :

Subject: [Boost-users] [serialization] Class version in binary archive
From: Guy Prémont (guy.premont_at_[hidden])
Date: 2010-11-02 17:03:03


Hi all,

 

I have a whole hierarchy of classes that is serialized without problem using
XML archive. When I wanted to use binary archive (that should be faster and
smaller), i met an little problem.

 

A bit of history, to make it easier to spot related changes in class
versions, we decided not to go with serial class version numbers (1, 2,
3...) but with meaningful version numbers: internal branch number + date. We
end up with class versions like 420100714 or 520101102.

 

In XML or text, no problem at all. In binary, it took me a while to find out
that class version numbers are serialized as unsigned char! However, the
documentation here
<http://www.boost.org/doc/libs/1_44_0/libs/serialization/doc/archive_referen
ce.html> says unsigned int. It is a bit surprising, since the type passed
to the serialization method is int.

 

I understand that I need to create my own binary archive to implement
save_override and load_override for version_type. However, doing the
override means that i am preventing the use of standard boost binary
archive. Is that a known bug, or is it even considered a bug?

 

Thanks

--
Guy Prémont, D.Sc.
Architecte logiciel senior / Senior software architect
CM Labs Simulations Inc.  <blocked::http://www.cm-labs.com/>
http://www.cm-labs.com/
Tel. 514-287-1166 ext. 237 



Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net