Re: [pygccxml-development] Implicit virtual functions in derived classes
Brought to you by:
mbaas,
roman_yakovenko
From: Roman Y. <rom...@gm...> - 2008-02-15 20:54:46
|
On Fri, Feb 15, 2008 at 3:22 AM, Julian Scheid <jul...@rs...> wrote: > Hi, > > I ran into the following problem with Py++ 0.9.0. > > Consider this class hierarchy: > > class A > { > public: > virtual void foo() {} > }; > > class B: public A > { > }; > > > This will not generate a wrapper for B even though B inherits A's > virtual function. Now if I have the following Python code: > > class C(B): > def foo(self): > print "C.foo" > > ... then when foo() is invoked on this instance on the C++ side of > things, the Python code won't be executed as the wrapper is missing. > > I managed to force generation of a wrapper for B, but even then it won't > generate the necessary override code (virtual void foo, void > default_foo, and the registration code.) > > My workaround is currently to manually add any implicit virtual > functions that I need to override, but this is cumbersome and > error-prone. Is there a way to configure or patch Py++ so that this is > not necessary? Thank you very much for bug reporting. Few minutes ago I committed fix and added new test case. The whole revision content: http://pygccxml.svn.sourceforge.net/viewvc/pygccxml?view=rev&revision=1238 The fix: http://pygccxml.svn.sourceforge.net/viewvc/pygccxml/pyplusplus_dev/pyplusplus/decl_wrappers/class_wrapper.py?r1=1238&r2=1237&pathrev=1238 I tested the fix again Py++ 0.9.5, but I guess it will also work for your version too. -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |