[C++-sig] Getting address of wrapped instance?

Renato Araujo renatox at gmail.com
Mon Dec 8 15:36:15 CET 2008


Hi Paul,

Maybe this can help you:
http://www.boost.org/doc/libs/1_36_0/libs/python/doc/v2/faq.html#xref

I use:
  python::object o(python::ptr(my_cpp_pointer));

then I got the python object.

BR

On Mon, Dec 8, 2008 at 11:23 AM,  <pyplusplus at assumetheposition.nl> wrote:
> Is there are way to get the address of the C++ instance pointed to by a
> given Boost.Python wrapper object? I don't need a real pointer, the
> address alone suffices.
>
> The use case is to deduce interrelations between C++ objects (think a DAG)
> from Python. As different Python wrapper objects might reference the same
> C++ instance I can't use id() or repr() of the Python object.
>
> Thanks,
> Paul
>
> _______________________________________________
> Cplusplus-sig mailing list
> Cplusplus-sig at python.org
> http://mail.python.org/mailman/listinfo/cplusplus-sig
>



-- 
Renato Araujo Oliveira Filho


More information about the Cplusplus-sig mailing list