[C++-sig] shared_ptr object identity

2010-08-15 Thread Erlend Cleveland
Hi all, I've been bashing my head against a wall for the past couple of days trying to figure this out. It's frustrating because it seems like it should be such a simple thing. I've also read through every archived message I can find relating to this topic, but just can't seem to pull it all toget

Re: [C++-sig] shared_ptr object identity

2010-08-15 Thread Ralf W. Grosse-Kunstleve
Hi Erland, > I've been bashing my head against a wall for the past couple of days > trying to figure this out. It's frustrating because it seems like it > should be such a simple thing. I cannot be so simple if you think of the C++ side as being unaware of the Python layer. Each time the C++ fun

Re: [C++-sig] shared_ptr object identity

2010-08-15 Thread Erlend Cleveland
>> I've been bashing my head against a wall for the past couple of days > >> trying to figure this out. It's frustrating because it seems like it >> should be such a simple thing. > > I cannot be so simple if you think of the C++ side as being unaware of > the Python layer. Each time the C++ functi

Re: [C++-sig] shared_ptr object identity

2010-08-15 Thread Ralf W. Grosse-Kunstleve
Hi Earl, > So I would wrap member functions returning the shared_ptr, and store a > persistent reference to the python object, returning its shared_ptr > instead? Yes. > > - Add all data attributes to the C++ object (and use .def_readonly() or > > .def_readwrite()). > > Then the state of the o