Boost logo

Boost :

From: tom-list_at_[hidden]
Date: 2001-04-01 00:57:22


David,

Thanks for the response. I'll read your proposed solution and
respond sometime tomorrow (sunday).

But in the mean-time, I'd like to make a couple of quick comments on
the documentation while my initial impressions are still fresh.

My reading of the existing docs is that they start with the
justification, then move on to features. What's there is good, but I
would have liked to start with an introduction. I mean something
with info like this:

Boost.Python adds two Python extension types: class & instance.
It allows the C++ user to expose classes, methods, and functions.
It allows the Python user to create instances from the exposed
classes.
And maybe something about the conversion functions.

Tom.

--- In boost_at_y..., "David Abrahams" <abrahams_at_m...> wrote:
> This has come up several times. There is a limitation in
Boost.Python which
> makes trying to do what you want dangerous at best. I posted a
proposed
> solution at http://groups.yahoo.com/group/boost/message/10144, but
given the
> deafening silence I got as a response, I just keep directing people
at the
> section titled "If you can't (afford to) copy the referent, or the
pointer
> is non-const" on this page:
> http://www.boost.org/libs/python/doc/pointers.html.
>
> I would happily make the proposed change to Boost.Python, but would
like to
> hear /something/ from users before undertaking any redesign.
>
> -Dave
>
> P.S. we don't say "BPL" anymore... we at boost are afraid of
running out of
> acronyms ;-).
>
>
> ----- Original Message -----
> From: <tom-list_at_h...>
> To: <boost_at_y...>
> Sent: Saturday, March 31, 2001 5:20 PM
> Subject: [boost] creating a BPL instance from an existing C++
object.
>
>
> > I'm using VC6 SP4 on Win2K SP1, with Boost 1.21.1 & Python 2.0.
> >
> > I want to create a 'BPL extension instance' object from an
existing
> > C++ object.
> >
> > Let me start with a conventional use of the BPL that leads to my
> > problem...
> >
> > My extension module creates a BPL extension class based on a C++
> > class (call it CB).
> >
> > The user instantiates it ...
> > >>> B = CB();
> >
> > Now BPL code instantiates the associated C++ class and ties it to
the
> > new BPL extension instance object. Correct?
> >
> > To get to my problem, let's say that the C++ class CB contains
> > another class CBa. Then CBa will automatically get instantiated
when
> > the BPL code instantiates CB.
> >
> > The CBa class, by the way, is wrapped, so there is an associated
> > Python (BPL extension instance) type, but since CBa got
instantiated
> > from C++, there is no associated Python object.
> >
> > I want to provide Python access to the existing C++ instance of
CBa,
> > and I don't know how. I'm going to start looking around in the
BPL
> > source code in the hopes of figuring out how to do this, but if
> > anyone knows offhand that it is or isn't possible, please let me
know.
> >
> > Thanks,
> > Tom.
> >
> >
> > To unsubscribe, send email to: <mailto:boost-unsubscribe_at_y...>
> >
> >
> > 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