From: Jose Orlando Pereira (jop_at_[hidden])
Date: 2000-11-22 10:33:30
On Tuesday 21 November 2000 16:00, you wrote:
> Here I'm demonstrating my lack of familiarity with XTL, but just to
> clarify, I/O and object description are treated as separate concepts?
Yes. As well as in the current version of persistence. :-)
> If so, I would not have any problem using <<. However, I'm not sure why I
> would want to use >> to add something to a description rather than take
> something from it :->
Notice that the composite() method (describe() method in
persistence) does not "build a descriptor", in the sense that
no runtime data structure describing the class is built. The
code itself describes the structure in the sense that it is
generic code that can visit each of the elements of the structure.
Depending how you instanciate template parameters you might
be using the generic visitor code to do different things.
Thus, the XTL syntax: you describe each field as being simple()
(i.e. the type is enough), being a pointer() (i.e. besides knowing
the type you describe it as possibly being NULL), being a reference()
(i.e. besides knowing the type you describe it as not being NULL)
and so on...
To do IO, the template parameter is instantiated with a class
(objio in XTL) that for each "kind of data" (i.e. type plus
annotation where required) calls the appropriate methods to
generate formated output (in the format layer).
> Understood. In the context of Boost, and for both proposals, is it
> appropriate to consider the next step forward in terms of syntax?
Using a syntax such as:
descriptor << optional(i) << required(j);
how do you ensure that for different instantiations of the descritor
type you select corresponding instantiations of optional() and other
annotations. Notice that in the current XTL syntax this is easy as
annotations are methods of the stream/descritpor class.
On the other hand, if we manage to do this wihtout killing
optimization it would be very nice. I'll think about this.
-- Jose Orlando Pereira * mailto:jop_at_[hidden] * http://gsd.di.uminho.pt/~jop *
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk