Re: [pygccxml-development] Function adaptors
Brought to you by:
mbaas,
roman_yakovenko
|
From: Roman Y. <rom...@gm...> - 2009-08-23 18:17:04
|
2009/8/21 Berserker <ber...@ho...>:
>> >> ::boost::python::class_< Foo_wrapper, ::boost::noncopyable >( "Foo",
>> >> ::boost::python::init< >() )
>> >> .def(
>> >> "public_virtual"
>> >> , (void ( Foo_wrapper::* )( ))
>> >> (&Foo_wrapper::default_public_virtual) )
>> >> .def(
>> >> "protected_virtual"
>> >> , (void ( Foo_wrapper::* )(
>> >> )(&Foo_wrapper::default_protected_virtual) ) );
>> >
>> > virtual public/protected functions (with "base" call from Python) works
>> > as
>> > expected
>> > with no "hacks" (tested from Python<->C++).
>>
>> I will try to integrate this soon ( +- 2days ).
>
> Thanks! I'll wait for your feedback :D
>
>>
>> > Why Py++ declares virtual public/protected functions as:
>> >
>> >> .def("public_virtual", (void ( ::Foo::* )( )
>> >> )(&::Foo::public_virtual),
>> >> (void ( Foo_wrapper::* )( )(&Foo_wrapper::default_public_virtual) )
>> >
>> > insted of simply:
>> >> .def("public_virtual", (void ( Foo_wrapper::* )(
>> >> )(&Foo_wrapper::default_public_virtual) )
>> >
>> > when we have a wrapper class?
>> >
>> > I hope that this change seems reasonable to you.
>>
>> It is. I have many tests in this area so will find out whether it
>> works or have some other problems.
>
> I really hope it works so that we can solve this problem ;)
Hi. I started to work on this and it seems I am missing something.
Can you post a small and complete example:
* C++ code original
* Boost.Python code
* Python code, which derives from the C++ class
Thank you.
--
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/
|