Re: [pygccxml-development] Function adaptors
Brought to you by:
mbaas,
roman_yakovenko
From: Roman Y. <rom...@gm...> - 2009-08-24 20:02:06
|
2009/8/24 Berserker <ber...@ho...>: > "foo.test_public()" works as expected becase PyFoo.virtual_public invokes > the base method on Foo_wrapper::default_virtual_public, instead > "foo.test_protected()" causes an infinite loop because it invokes > PyFoo.virtual_protected > which invokes Foo_wrapper::virtual_protected (which invokes > PyFoo.virtual_protected and so on...). > As I proposed before, I think that it is necessary to generate a > "Foo_wrapper::default_virtual_protected" function in the same way of > "Foo_wrapper::default_virtual_public" and to change the "exposition" part in > this way: > >> void register_Foo_class(){ >> >> ::boost::python::class_< Foo_wrapper >( "Foo", ::boost::python::init< >> >() ) >> .def( >> "virtual_protected" >> , (void ( Foo_wrapper::* )( ) >> )(&Foo_wrapper::default_virtual_protected)) >> .def( >> "virtual_public" >> , (void ( Foo_wrapper::* )( ) >> )(&Foo_wrapper::default_virtual_public) ); >> >> } > > Hope it helps :) Yes and me too: http://pygccxml.svn.sourceforge.net/pygccxml/?rev=1756&view=rev Let me know whether it solved your problem or not and what compiler you used. -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |