Saturday, July 18, 2009

Special Japan Edition

I'm writing from Kawaguchiko, at the base of Mt. Fuji. Work officially demanded my attention today...with a vengence.

What I've been trying to do with SWIG might be outright impossible. It has severe problems when trying to inherit from a standard, templatable object.

Unlike other SWIG directives which should be defined prior to reading in aheader file, you need to put %template after the *template* class isdeclared but *before* that template class used. Which creates a problem ifthe template class is created in the same header file where it is used (andyou don't own the header file). I have submitted a bug/enhancement requeston this:

http://sourceforge.net/tracker/?func=detail&aid=2502006&group_id=1645&atid=101645

This is still a big issue for me given that I'm wrapping a few thousandclasses of which a number of them have this problem. I think thatultimately I'll need to familiarize myself with the SWIG source code and fixthis myself (unless other SWIG developer with free time wants to pick thisup :)).

Thanks,
-James

The workaround might be making my own vector .i file. This is not exactly pleasing, but it seems it might be the only way to do this.

Otherwise, just spent a few hours ironing out the wrinkles in NumCalc. Managed to get some more .i files to compile with SWIG. But the big problem is still ParameterList, which a ton of things use, and which inherits from vector. This is not going to be pretty.

1 comment:

  1. Sounds similar to some of XIn's problems with libsequence. Did you try James' suggestion on the interface file?

    ReplyDelete