I have a class in C++, let's call it A. A has a member function which returns objects of class B. 'thing is, B has a pointer to A.
I know how to wrap A and all its members into a python class, APy - and I know how to wrap B into BPy. But what I can't figure out is how to add a reference from BPy to APy - in order to make sure A exists until all APy and BPy are destroyed.
I thought about implementing A and B to both use a boost::shared_ptr to the actual data object, but somehow I have the feeling there should be a simpler way. If somebody could point me in the right direction, that would be great!
Thanks a lot