[C++-sig] [boost.python] Exposing abstract derived classes
Maxi.Matthe at web.de
Mon Jul 14 21:04:53 CEST 2008
I have a problem with exposing derived classes to python:
virtual void f() = 0;
class Derived : public Base
virtual void g() = 0;
// here's how to wrap and expose Base:
class BaseWrap : public Base, public wrapper<Base>
.def(f, pure_virtual(&BaseWrap::f)) ;
// How should I wrap and expose Derived?
// It is also pure virtual, but if I create a wrapper that
// derives from Derived and wrapper<Derived> and create the method
// g(), f() is still not implmented, thus it does not compile.
I do not feel comfortable by deriving DerivedWrapper from BaseWrapper,
Derived and wrapper<Derived>, which could even not work because of
same base classes and so on.
So what is the right implementation for my problem?
More information about the Cplusplus-sig