Re: Re: Serialization Formal Review #2

Matthias Troyer wrote:
I have two more questions regarding the serialization library which I need to have answered before I can see if I can read my old archives with your library:
1. when overloading the save/load functions in an archive, do I bypass writing preambles and other class information or do I need to overload operator <<? What is the difference between implementing operator<< and save?
2. which functions do I need to implement in my archive class to skip writing the standard preamble that your archives write? Is it just the init function or are there more functions?
Depending on the implementation traits for each class, there may be a preamble written by the serialization library. This contains information such as version number, class id info, perhaps export key, etc required by the s library to reconstruct a faithful reproduction of the original data. If there is a preamble, there is no information in that can be discarded and still reproduce the original data. In general it can't be guaranteed that one can read an arbitrary file format created independently of the serialization library. With the serialization library, it's the class/instance structure that drives the file format rather than the other way around. To transition to use the serialization library the strategy would be: a) add serialization to the classes desired. b) write a program which reads the "old" data files using the "old" method - whatever that might be. c) invoke serialization to save in the desired new format. The old data files should no longer be necessary. Best regards Matthias

Dear Robert, On Apr 17, 2004, at 8:13 AM, Robert Ramey wrote:
Matthias Troyer wrote:
2. which functions do I need to implement in my archive class to skip writing the standard preamble that your archives write? Is it just the init function or are there more functions?
Depending on the implementation traits for each class, there may be a preamble written by the serialization library. This contains information such as version number, class id info, perhaps export key, etc required by the s library to reconstruct a faithful reproduction of the original data. If there is a preamble, there is no information in that can be discarded and still reproduce the original data.
I was wondering about the preamble written at the start of the archive, not the per-class information. Matthias
participants (2)
-
Matthias Troyer
-
Robert Ramey