Boost logo

Boost :

From: Robert Ramey (ramey_at_[hidden])
Date: 2004-10-26 11:07:18

"Hubert Holin" <Hubert.Holin_at_[hidden]> wrote in message
> somewhere in the E.U., le 26/10/2004

> I could not get your code to compile (either using MWCWPro8.x or
> Xcode 1.5), so I could not test it. From what I understand (I may be
> wrong, of course), the output should works more or less like the
> non-fancy one already in place. However, its the input that's the core
> of the problem.

Serialization of arrays fails with CW 8.3. Also serialization of pointers
fails with all CW compilers at runtime. So far we have been unable to
resolve these issues with this particular compiler.

> Granted, you code will most likely read a quaternion which would
> be in a text file in the form (excluding the quotes written here for
> clarity) "(1.0, 2.0, 3.0, 4.0)". But will it also accept "1.0", "(2.0,
> 3.0)" and "((1.0, 2.0), (3.0, 4.0))" while refusing "((1.0, 2.0), 3.0,
> 4.0)"?

With the serialization library is intended to be used to save and restore
the state of an arbitrary set of C++ data structures. The particular format
used to store the data is implemented as and "archive class". The archive
class can be selected independently of the data to be serialized. Some
archives have readable or semi-readable formats. E.g XML or plain text,
while others or opaque to human perception - binary. The data stored in an
archive is designed to capture all the information required to restore it to
its original state and is driven by the structure of the data saved.
Serialization is not intended for and generally not suitable for reading and
parsing some other input format.

Here is where I believe the confusion lies.

a) If one wan't to display something for human consumption such as a report,
debug log or what ever, An output format library might be useful.
b) If one wants to save and restore something to its original state, the
serialization libary will be useful.
c) If one wants to read some input text in some specified format, parse it
and generate some data instances - spirit may be helpful.

Serialization does include one "user friendly" archive format - XML but it
may not be what one wants. It might be possible to generate an archive
which displays data in a way different than XML but is still suitable for
human consumption - but no one has shown any interest in this idea.

Generally, I would think that concentrating on using the above tools for the
above purposes rather than trying to extend them too far beyound thier
original motivation and design goals will lead to more complexity and
overlapp than necessary or desirable.

Robert Ramey

Boost list run by bdawes at, gregod at, cpdaniel at, john at