I asked this in Stackoverflow, but I haven't got a good response (although the one I got was in the right track I think).

I have an enum myEnum, and the following methods in C++:

void MyClass::SetValue(myEnum newValue);
void MyClass::GetValue(myEnum& theValue);

I'm using the "enums.i", and myEnum has properly been converted to a Java enumSetValue works correctly, but GetValue takes one of the strange SWIGTYPE_p_myEnum_ptr classes that I cannot create.

Is there a way of automatically creating a wrapper for all enum references? Something like a class that contains the enum value, so it can be passed around and modified?

What I'm currently doing is "%apply int* OUTPUT {MyEnum &}" and this converts the enum value into an array, but it will be nice if I can get the GetValue to return the value instead, or what I said earlier (a wrapper with the value inside).

Thank you in advance :)