[C++-sig] R: Re: R: Re: Boost.Python type registry
Ralf W. Grosse-Kunstleve
rwgk at yahoo.com
Fri Oct 5 20:46:26 CEST 2007
Would it help you if you had an interface to extract an array of
type_info objects known to the registry?
If you send patches with docs I'll review them.
BTW: What you need seems very unusual. Could you explain the situation?
Did you consider alternative approaches?
----- Original Message ----
From: François Duranleau <duranlef at iro.umontreal.ca>
To: jumpjoe at fastwebnet.it; Development of Python/C++ integration <c++-sig at python.org>
Sent: Friday, October 5, 2007 8:22:20 AM
Subject: Re: [C++-sig] R: Re: R: Re: Boost.Python type registry
On Fri, 5 Oct 2007, jumpjoe at fastwebnet.it wrote:
>> I think that you can search the registry for entry with m_class_object
>> that matches your PyObject's type or search the lvalue_chain(s) for a
>> converter that returns !=0. But there is no api for that so far.
> This is another interesting approach, but after a few tries, I
> discovered the registry is really hard to get by, as it is a static
> variable defined in a "hidden" function in an anonymous namespace in the
> registry.cpp file. Any suggestions on how to extract it? As an "extern"
> of some kind?
Without modifying the source code, there is no way. The only way to search
the registry externally is via the boost::python::converter::query
function, but then you need to provide a type_info, and to do this
exhaustively is not really simpler than using an "inverse" registry like I
C++-sig mailing list
C++-sig at python.org
More information about the Cplusplus-sig