Boost logo

Boost :

From: David Abrahams (david.abrahams_at_[hidden])
Date: 2002-03-01 09:33:08


Has anyone considered describe /types/ instead of describe methods?
One very clever system I've seen used globally-declared structure instances
to do this job. I don't remember the details at all, so this could be
completely off-the-mark:

struct my_record : description<my_record>
{
    char const name[] = "my_record";
    member<int> x;
    member<int> y;
    ...
};

    ...

----- Original Message -----
From: "Peter Dimov" <pdimov_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Friday, March 01, 2002 7:54 AM
Subject: Re: [boost] Re: Serialization (Persistence) library draft
submission

> From: "Vladimir Prus" <ghost_at_[hidden]>
> > I don't think there's consensus on describe vs. load/save question.
Having
> > recorded this, I suggest that we postpone this question until other
issues
> > are resolved.
>
> A single describe() method doesn't work for the following reasons:
>
> 1. const correctness.
> 2. read/write assymetry.
> 2a. sequence serialization:
>
> template<class R, class T, class A> void read(R & r, std::vector<T, A> &
v,
> int)
> {
> int m = begin_sequence(r);
> v.resize(m);
> if(m > 0) read_sequence(r, &v[0], m, 0);
> end_sequence(r);
> }
>
> vs
>
> template<class W, class T, class A> void write(W & w, std::vector<T, A>
> const & v, int)
> {
> int m = v.size();
> begin_sequence(w, m);
> if(m > 0) write_sequence(w, &v[0], m, 0);
> end_sequence(w, m);
> }
>
> 2b. versioning. When Complex version 1 is serialized as polar coordinates
> but version 2 is cartesian, read/write are assymetric.
>
> There probably is a solution to these problems but I haven't found it yet
> ('cause I didn't look that hard.)
>
>
>
> Info: http://www.boost.org Send unsubscribe requests to:
<mailto:boost-unsubscribe_at_[hidden]>
>
> Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
>
>
>


Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk