[C++-sig] Py++ issues, plus switching from Swig

Nicolas Tessore wz_ at gmx.net
Wed Aug 30 20:20:59 CEST 2006


Hello, I hope someone can help me out:

I am relatively new to Python, and not too experienced in C++.
My situation is the following: I am trying to add Boost.Python
bindings to a library consisting of about a hundred includes,
weighting 60Megs. It is heavily relying on inheritance, in fact
all classes derive from one base.

Now the tricky bit: The lib uses templates a _lot_. The small
part that is currently included in a Swig wrapper already
contains 800 specific template conversions.

What I now want to do is switch to Boost.Python for a change.
Swig creates a huge number of problems when using the lib, and
I trust Boost to perform better. Still there is one issue: Due
to the number of classes, templates and the frequent changes of
the codebase, I cannot generate the Boost.Python wrapper manually.
I tried using Pyste, but it is still too much work to add all
classes in an interface file. The only possibility is automation, as
presented in Py++.

The reason for posting is that I cannot find the documentation
explaining how to do templates in Py++. I can (and do) use typedefs +
declaration for templated types, but I need support for template
functions as well, since I need to access a lot of Dynamic and Static
casts, in fact, each single class needs it.

Could anyone give me a hint in the right direction, or at least tell me
that it is impossible in general, so I can hack the Swig interface to
at least stop segfault'ing?

Thanks in advance,
    N.
-- 


"Feel free" – 10 GB Mailbox, 100 FreeSMS/Monat ...
Jetzt GMX TopMail testen: http://www.gmx.net/de/go/topmail



More information about the Cplusplus-sig mailing list