Boost Python : How to only expose the constructor of a class with virtual (pure & impure) methods
Posted
by fallino
on Stack Overflow
See other posts from Stack Overflow
or by fallino
Published on 2010-04-16T17:34:55Z
Indexed on
2010/04/16
17:53 UTC
Read the original article
Hit count: 464
Hello, I'm a newbie with Boost::Python but I tried to search on the web to do so
I want to expose a 3rd party library to Python. One of the class of the library (.hpp) is composed of
a public constructor with arguments
a protected constructor and functions
various regular functions
various pure virtual functions
various non pure virtual functions
First, I did not succeed in building it without having errors about this protected constructor. I finally commented it. A first question would be : Is there a way to exclude these protected functions since I don't want to expose them ? (I know it's possible and easy with Py++, but I started without using it)
Then I tried to expose all of my functions, beginning with the pure virtual ones (commenting them all except one), which wasn't a success too
So I finally decided not to expose these virtual functions (which in fact seems logical...), but, here again, I didn't manage building it with a simple constructor with arguments (without no_init). So my second question is : Is there a way to exclude these virtual functions since I don't want to expose them ?
Sorry if it seems trivial but I didn't find anything explicit on the web and I need something rather explicit :).
Thanks in advance
© Stack Overflow or respective owner