|
From: Nick D. <nic...@gm...> - 2011-01-19 23:01:41
|
I would like to set typemaps for return values from methods differently than
those for parameters to methods. How can this be accomplished in a generic
fashion and not method specific?
For example, my expectation is that, having this:
%apply TYPE& OUTPUT { TYPE& };
Would make all my mapped methods that have TYPE& as a parameter be mapped in
C# as "out TYPE ...".
Which it does. The problem is this also appears to override how the C# code
is generated for the definition of the return value as well. ie. for the
C++ function, TYPE& myfunction(), SWIG produces:
public out TYPE myfunction()
which is obviously not legal C#, but I don't know how I'm supposed to
differentiate the typemaps for returns vs. parameters, other than to specify
each name of each parameter, which is terrible. At the very least, having
some kind of special variable that SWIG parsed inside,
%apply TYPE& OUTPUT { TYPE& $specialswigvar };
that would allow me to basically say this is only for parameters. But I
haven't found anything like that in the documentation. At least for the
%apply function anyway. Any help would be appreciated with this.
Cheers,
-Nick
|