Re: [pygccxml-development] Implicit virtual functions in derived classes
Brought to you by:
mbaas,
roman_yakovenko
From: Julian S. <jul...@rs...> - 2008-02-16 01:29:32
|
Roman Yakovenko wrote: > 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. There's also another problem with this approach (both your patch and my similar fix): the API I'm wrapping is a rather large class hierarchy, and nearly all classes are derived from a common base class with a large number of virtual functions. Let's say for the sake of argument that it's 100 classes and 10 virtual functions in the common base class. This leads to 1000 times the wrapper functions generated, with almost identical code in each wrapper. I found that my Py++ wrapper library, which is already quite large at roughly 20 MB, gets blown up to over 40 MB once I include the base classes' virtual functions. I wonder if it would be possible to derive wrappers from the base class wrapper to help reduce this overhead? E.g. in my example, derive B_wrapper from A_wrapper? Ideally you could also reuse the registration code so that register_B_class would call something like register_A_class_virtuals. Thanks, Julian |