From: David P. <dpi...@me...> - 2009-10-30 16:42:20
|
> If I declare the typemap in terms of the "raw" type all is well (i.e. > %typemap(in) Matrix * () { /* TYPEMAP Matrix */ } > ) > > I realise that you can define different typemaps for e.g. Matrix and > MatrixF, but my reading of the manual implies that both should be > tried in order; here no typemap is applied at all. The code won't > compile, by the way, as I removed the %inlines for clarity. > > R > > class Matrix {}; > typedef Matrix MatrixF; > > %typemap(in) MatrixF * () { /* TYPEMAP MatrixF */ } > > void goo(Matrix *mat) { } It's my understanding that the typemap for MatrixF* will only be used if your function declaration has a parameter of type MatrixF*. On the other hand, if the function declaration uses MatrixF*, then SWIG will use the MatrixF* typemap if it exists, otherwise it will use the Matrix* typemap if it exists. |