Re: [pygccxml-development] skipping base classes
Brought to you by:
mbaas,
roman_yakovenko
From: Roman Y. <rom...@gm...> - 2008-09-17 14:08:56
|
On Wed, Sep 17, 2008 at 4:06 PM, Ken McGaugh <ke...@dn...> wrote: > Hello all, > > After reading through the archives, docs, and the source code I cannot > find out a way to do the following. > > Say I have a class hierarchy like this: > > class A > [...] > > class B : public A > [...] > > class C : public B > [...] > > I need to expose to python the classes A and C, but not B. When writing > the boost::python code manually I do this: > > bp::class_<C, bp::bases<A> >("C") > > So that in python it thinks that C inherits directly from A and it all > works. But now that I'm using Py++ I cannot figure out a way to achieve > the same thing and I have to expose the intermediate classes, which for > various reasons I really don't want to do. > > So is there a way to do what I want in Py++? I am not sure. I never tested such case. Try to exclude "B" and see what happens. If it doesn't work I will have to tweak Py++ to support such case. It should not be too difficult. One possible work around is to export class "B", but without any members and to give it pretty ugly alias, starting with '__'. HTH -- Roman Yakovenko C++ Python language binding http://www.language-binding.net/ |