Re: [pygccxml-development] 2 Questions
Brought to you by:
mbaas,
roman_yakovenko
From: Roman Y. <rom...@gm...> - 2006-09-12 18:08:28
|
On 9/12/06, Allen Bierbaum <al...@vr...> wrote: > I have two questions that I am surprised I haven't run into before. I > hope that both have easy answers. > > 1. Base class virtual ignored, but coming in inside derived class wrappers. > > I have a base class and derived class like: > > struct Base > { > virtual const int* getData() const = 0; > }; > > struct Child : public Base > { } > > struct GrandChild : public Child > { > virtual const int* getData() const; > } > > In my py++ generation script I ignore the getData decl in the Base class > (and the GrandChild). But py++ still ends up generating wrapper code > for getData for the Child class. To make matters worse, since it is not > a decl for getData in the Child class I can not ignore it there. It is > almost like Py++ is seeing the virtual method and deciding that it needs > to provide a wrapper for it in Child even though it is ignored in Base. > Is this a bug in Py++ or is there some way that I can take care of this. Do you know how hard I work to implement this? Basically this is because wrapper classes could not be abstract. Also untill now I didn't have use case where user ignore some method. May be I will have to take a look on it. > > 2. The alternative option would be to just wrap the method correctly, > but how can I wrap returning a memory buffer (array) of arbitrary length? > > Is there a way to wrap this method so it will return a const wrapper > around this data buffer to make it look like a python list? If so what > is the easiest way to do it and do I really need to wait for MB's method > transformer code to do it right? You don't have to wait, you can join and help :-). Take a look on TnFOX Python bindings, they deal with the same problem ( image classes ). It uses indexing suite v2 to solve the problem. -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |