From: David Abrahams (abrahams_at_[hidden])
Date: 2001-03-26 21:58:12
----- Original Message -----
From: "Karl Bellve" <Karl.Bellve_at_[hidden]>
> I am still confused about this. Perhaps Boost (BPL) is unable to do
> I don't want to have a method in Python create a new object, like you do
> with n.getWorld(). I don't want to construct a new class in python, only
> to have a function in C++ construct another class, then free the first
> class. In all these cases, a new object is constructed.
> I just want to pass a class to Python that has already been constructed,
> without Python or BPL constructing a new object from a class. My
> application has already did a new <someclass>. It has already
> initialized the class, and loaded various pieces of data. I just want
> the data and some of the functions in that class available to Python.
There is only one way, but it is dangerous. See
http://www.boost.org/libs/python/doc/pointers.html, the section titled "If
you can't (afford to) copy the referent, or the pointer is non-const".
Replace the usage "ptr_to_python" with "smart_ptr_to_python".
Good luck to you and the Red Sox,
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk