|
| <prev next> |
Reseting swigCMemOwn inside a method: msg#00206programming.swig
Hi! << Sorry if you get a duplicate copy of this message. My first attempt didn't got through. >> I`m trying to reset the swigMemOwn flag of an object after it has been passed to a method that aquires ownership of its parameter. I'm trying to use a javain typemap, but I confess I haven't got the grip of typemaps. For our python bindings, I`m using the following syntax (borrowed from a previus post I've found in the archives): %typemap(python,in) core::ServerUniverseObject *p_obj_ptr { if ((SWIG_ConvertPtr(obj1,(void **) &arg2, SWIGTYPE_p_core__ServerUniverseObject,SWIG_POINTER_EXCEPTION | 0 )) == -1) SWIG_fail; PyObject_SetAttrString( $input, "thisown", PyInt_FromLong((long)0) ); } In java I'd like to do something like this: %typemap(javain) core::ServerSyncObject *p_obj_ptr { corelibsjJNI.ServerUniverseData_addSyncObject(swigCPtr, p_obj_ptr); p_obj_ptr.swigCMemOwn = false; } But the resulting wrapper code is rather strange to me: public void addSyncObject(ServerSyncObject p_obj_ptr) { corelibsjJNI.ServerUniverseData_addSyncObject(swigCPtr, { corelibsjJNI.ServerUniverseData_addSyncObject(swigCPtr, p_obj_ptr); p_obj_ptr.swigCMemOwn = false; }); } Can any of you give me a hand on getting it right (and maybe undersdanting typemaps better)? All the best wishes, -- Marcelo A. Camelo - Game Programmer Hoplon Infotainment - Brazil _______________________________________________ Swig maillist - Swig@xxxxxxxxxxxxxxx http://mailman.cs.uchicago.edu/mailman/listinfo/swig |
|
| <Prev in Thread] | Current Thread | [Next in Thread> |
|---|---|---|
| Previous by Date: | Re: warnings when using directors with multiple throw specifiers: 00206, Oren Miller |
|---|---|
| Previous by Thread: | derived typesi: 00206, David E. Konerding DSD Staff |
| Indexes: | [Date] [Thread] [Top] [All Lists] |
| News | FAQ | advertise |