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

Will Welch pyqwt at quietplease.com
Fri Nov 10 03:50:05 CET 2006


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?

thanks,

-- will




More information about the Cplusplus-sig mailing list