Re: [pygccxml-development] Function adaptors
Brought to you by:
mbaas,
roman_yakovenko
|
From: Roman Y. <rom...@gm...> - 2009-08-21 08:14:39
|
2009/8/20 Berserker <ber...@ho...>:
> I made some other tests :)
> If I simply declare (assuming that we always have a wrapper class):
In case of exported non-public virtual member function the wrapper always exists
>> ::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 ).
> 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.
> P.S.: Thanks for your patience :D :D :D
:-), just keep testing what you propose and will be fine
--
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/
|