Boost logo

Boost :

From: David Abrahams (david.abrahams_at_[hidden])
Date: 2001-06-20 08:23:05


I just took a look at the HTML documentation. I found it left me with many
questions. For example, how is the "base class counter" used? If I am
supposed to increment it to inject multiple bases, how does that jibe with
the example at the bottom of the page? What does "tagging hierarchy
versions" mean? This section is completely lost on me. Also, the docs need
some motivating explanation. Why would I want to do this? It seems
preferable to me, as long as I am going to end up with a class template
anyway, to make it adaptable so I can make any number of different
variations (c.f. iterator_adaptor) rather than just changing the bases of
what is essentially a single entity.

-Dave

Maybe the PDF docs will shed more light...

----- Original Message -----
From: "Douglas Gregor" <gregod_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Wednesday, June 20, 2001 8:28 AM
Subject: Re: [boost] Re: Base Class Injection

> On Wednesday 20 June 2001 01:02, you wrote:
> > --- In boost_at_y..., Douglas Gregor <gregod_at_c...> wrote:
> > > I have written a small library that performs base class
> > > injection, which essentially allows the user to take a
> > > class A and "inject' it as a base class of some other
> > > class R. The injection is done without modifying R's source
> > > code, so it is a powerful method of separating concerns. The
> > > following example is paraphrased from the paper at:
> > >
> > > http://www.cs.rpi.edu/~gregod/papers/base_class_injection.ps
> >
> > Is there a PDF of this paper. Reading PostScript directly is
> > somewhat of a pain for non-UNIX users.
>
> I remembered to use zip to help out the non-UNIX users, but never thought
> twice about using Postscript :)
>
> The PDF is now available at:
> http://www.cs.rpi.edu/~gregod/papers/base_class_injection.pdf
>
> > > which describes the concept much more cleanly. The library
> > > itself is located at:
> > >
> > > http://www.cs.rpi.edu/~gregod/libraries/injection.zip
> >
> > [SNIP example]
> >
> > > Is there interest for this technique within Boost?
> >
> > I downloaded the *.ZIP file, and this looks kewl. I haven't tried
> > compiling the code yet. We should add it to Boost, if there's no
> > problems with its interactions with Standard C++.
> >
> > Daryle Walker
> > [posting through web interface]
>
> It's legal C++. Since the 'receiver' classes (those that are able to
receive
> injections) are template classes that derive from the injection::bases
> template (which is dependent on all of the template parameters),
injections
> can be made up until the point of instantiation. The 'Tag' template
parameter
> keeps our full specializations as partial specializations so instantiation
is
> performed as late as is possible.
>
> Doug
>
> Info: http://www.boost.org Unsubscribe:
<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