Re: [pygccxml-development] Function adaptors
Brought to you by:
mbaas,
roman_yakovenko
From: Berserker <ber...@ho...> - 2009-08-21 08:46:42
|
> >> ::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 ;) Bye _________________________________________________________________ Porta Messenger in Vacanza! Scaricalo sul cellulare! http://new.windowslivemobile.msn.com/IT-IT/windows-live-messenger/default.aspx |