|
From: William S F. <ws...@fu...> - 2010-09-27 20:30:31
|
Tomas Walch wrote:
> This is my (simpified) situation:
>
> In my C++ code I have methods like this:
>
> bool SetValue(const MyString& value);
> bool GetValue(MyString& value);
>
> I have written specialized typemaps that map between MyStrings and Python str like this
>
> %typemap(in) const MyString& {
> ...
> }
>
> %typemap(in, numinputs=0) MyString& OUTPUT (MyString temp) {
> $1 = &temp;
> }
>
> %typemap(attrout) MyString& OUTPUT {
> ... // packs a tuple of bool and str
> }
>
> The translation code all works fine
> I apply the typemaps like this:
>
> %apply const MyString& { const MyString& value };
> %apply MyString& OUTPUT { MyString& value }
>
> My problem is that the attrout typemap is also applied to 'const MyString& value', which I don't want.
> So when I call SetValue from Python it returns a tupe of (bool, str), like GetValue...
>
There is no typemap named 'attrout', so I've no idea what is going on!
William
|