Boost logo

Boost :

From: Dave Harris (brangdon_at_[hidden])
Date: 2002-12-13 10:06:37

In-Reply-To: <20021213033514.82232.qmail_at_[hidden]>
On Thu, 12 Dec 2002 19:35:14 -0800 (PST) Augustus Saunders
(infinite_8_monkey_at_[hidden]) wrote:
> Me: I'm not sure what kind of generic versioning we can provide.
> What benefit do we provide over the application author
> serializing/deserializing his or her own version?

Java does quite a lot in this line. It has enough metadata available, both
of the running program and in the archive, to be able to detect missing or
surplus fields, changes in inheritance hierarchy etc, and fix them up.
Many tagged formats (including XML and RTF) are designed to allow
unexpected or unknown fields to be skipped during loading.

Some of this is doable within the frame work I have in mind. For example,
given code like:

    void MyClass::load( iarchive &ar ) {
        ar.begin( "MyClass" );
        ar >> tag("name") >> name;
        ar >> tag("address") >> address;
        ar >> tag("zipcode") >> zipcode;

if the archive does not contain a "zipcode" field, the zipcode variable
would not be modified. Any fields provided in the archive and not read by
the time ar.end() is called, would be discarded.

It would even be possible to allow the archive to provide the fields in
reverse order. Eg the data could look like either:

This would mean reading all the data in advance and storing it in some
kind of tree structure. The UDT code shown would actually traverse the
tree and use random access at each node.

Like you, I question the value of doing this stuff. It makes me feel

-- Dave Harris

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