|
From: Juan H. <jhe...@la...> - 2009-12-03 16:25:40
|
Hello William,
Thanks for your answer
> I think might be missing something, but the type of the premature
> garbage collection prevention parameter is always long
Using the default typemaps, isn't the pgcp the same type as the input
parameter (Foo and B::Foo in this cases) and 'long' the actual parameter
passed to the underlying JNI function? Or am I misundertanding the
reference manual?
> and the following:
> %rename(BFoo) B::Foo;
> %typemap(jstype) B::Foo & "B.Foo"
> %typemap(javain) B::Foo & "B.Foo.getCPtr($javainput)"
>
> generates:
> public void f(B.Foo x) {
> exampleJNI.Problematic_f__SWIG_1(swigCPtr, this, B.Foo.getCPtr(x), x);
> }
>
> which is what I think you want.
I'm still having a small compilation problem but the %rename was the
piece I was missing, it has to be guarded by %ifdef clauses depending on
the module swig is processing but it basically works. Thanks for
pointing it out! I think I'll be able to work out the rest on my own.
> PS don't forget you can used named typemaps by changing the typemap
> types from B::Foo & to B::Foo &x to target just the x variable.
Sure, I've read it in the docs. However in this case I'm looking for a
global typemap if possible.
Best regards,
Juan
|