[C++-sig] Best practices for wrapping classes where instance lifecycle is managed by someone else?

2010-07-09 Thread Mikael Lind
I'm using Boost.Python to wrap Box2D, a 2D physics engine written in C++. The user of Box2D starts by constructing an instance of class b2World. The b2World class has member functions for creating and destroying bodies and joints (for constraining the movement of the bodies). The b2Body class has m

Re: [C++-sig] Best practices for wrapping classes where instance lifecycle is managed by someone else?

2010-07-09 Thread Renato Araujo
Hi Mikael Lind Check: http://www.boost.org/doc/libs/1_43_0/libs/python/doc/v2/with_custodian_and_ward.html#with_custodian_and_ward-spec, if this not work to your problem this can help you to implement a new policy. BR Renato Araujo Oliveira Filho On Fri, Jul 9, 2010 at 5:05 AM, Mikael Lind