[C++-sig] pyste, abstract classes, policy inheritance

Roman Yakovenko roman.yakovenko at gmail.com
Fri Nov 10 09:41:10 CET 2006


On 11/10/06, Will Welch <pyqwt at quietplease.com> wrote:
> hi,
>
> i'm using pyste on a chain of classes that derive from an abstract
> base. one of the member functions returns a pointer type that needs a
> policy declared for it. i'm noticing that i must do the set_policy for
> this function in each class along the inheritance chain, rather than
> just once for the abstract base. is there a workaround for this? i'm
> brand new to boost.python and pyste, unsure if this is a boost thing or
> a pyste-generated wrapper thing.
>
> i don't actually want to ever call that function, by the way, but using
> exclude() nets me errors about it being an abstract virtual function
> (presumably because it is left out of the wrapper class), and that
> causes its wrapper's m_held declaration to fail. how does one use
> exclude() in this situation?
>
> finally, speaking of pyste-generated wrappers and abstract classes:
> i've noticed that having no virtual functions in a class that derives
> from an abstract class, means that the needed wrapper for the derived
> class isnt produced by pyste. current workaround is to add a fake
> virtual function declaration to the derived class. is there a fix that
> does not involve changing the c++ source?

Pyste is not under development any more. Try Py++. It is very easy to do
what you are asking for with it:
http://language-binding.net/pyplusplus/pyplusplus.html

-- 
Roman Yakovenko
C++ Python language binding
http://www.language-binding.net/



More information about the Cplusplus-sig mailing list