Roman Yakovenko wrote:
> On 9/19/06, Allen Bierbaum <al...@vr...> wrote:
>
>> Roman Yakovenko wrote:
>>
>> > On 9/19/06, Allen Bierbaum <al...@vr...> wrote:
>> >
>> >> I am having trouble wrapping a class right now. The problem is
>> that the
>> >> class uses template base classes to mixin functionality. This
>> makes it
>> >> appear to pygccxml that the class has a half-dozen base classes.
>> But I
>> >> don't want to expose these base classes, all I want to expose is the
>> >> class that is composed from the mixin functionality.
>> >
>> >
>> > I understand.
>> >
>> >> To make matters
>> >> worse there is something in the handling of these mixins that is
>> making
>> >> pyplusplus code creators expose them all as having the same name
>> >> ("Inherited"). I think this is because each mixin class uses a
>> typedef
>> >> called Inherited to keep track of the class that it is inheriting
>> from.
>> >
>> >
>> > This is the right guess.
>> >
>> >> (I have attached a file that shows the basic idea, but it is a vast
>> >> simplification of the case I am really trying to handle)
>> >>
>> >> Anyway, to make a long story short, what I would like to do is
>> just tell
>> >> pyplusplus to ignore the base classes (ie. don't expose them) but to
>> >> instead pull all of the methods defined in those base classes into
>> the
>> >> derived class I am trying to expose. Then the generated code
>> would only
>> >> create a wrapper for the derived class and would just create "def"'s
>> >> that reference the methods from the mixins.
>> >>
>> >> Is this possible?
>> >
>> >
>> > What do you think? Before I answer the question, I would like to make
>> > it clear:
>> > this is not "the main success scenario", so you will have to touch
>> > here and there
>> > few low level details.
>
Sorry to reply to an old thread, but I was just dealing with this
problem in another case and I started thinking about it again.
I agree that this it outside the normal usage scenario for py++, but I
just thought of a reasonable way for the user to think about this in a
way that may be useful to many more people.
Namely, I was thinking that if the user exposes a class Derived but the
class Base is not exposed, I think it would be reasonable for Py++ to
automatically expose all the methods of Base in Derived. This seems
like a fairly reasonable usecase because there may just be some times
that users only want to expose a couple of classes and don't want to
expose all of their base classes.
What do other people think, is this a common enough usage to make a
feature request out of it?
-Allen
|