List Info

Thread: R: Re: R: Re: Boost.Python type registry




R: Re: R: Re: Boost.Python type registry
country flaguser name
Netherlands
2007-10-05 08:23:46

>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?

Cheers,
Giovanni Beltrame
_______________________________________________
C++-sig mailing list
C++-sigpython.org
http:
//mail.python.org/mailman/listinfo/c++-sig

Re: R: Re: R: Re: Boost.Python type registry
country flaguser name
Canada
2007-10-05 10:22:20
On Fri, 5 Oct 2007, jumpjoefastwebnet.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 
mentionned.

-- 
Francois Duranleau
_______________________________________________
C++-sig mailing list
C++-sigpython.org
http:
//mail.python.org/mailman/listinfo/c++-sig

[1-2]

about | contact  Other archives ( Real Estate discussion Medical topics )