问题
I'm using Swig to generate Java classes.
I need to deal with a pointer on a pointer on a structure.
I have this structure :
struct Model {
uint32_t serial;
}
And I have a function in the C/C++ that needs to be wrapped :
void getModel( Model ** model ){
// instructions...
}
I get as a result this Java class :
public class SWIGTYPE_p_p_Model {
private long swigCPtr;
protected SWIGTYPE_p_p_Model(long cPtr, boolean futureUse) {
swigCPtr = cPtr;
}
protected SWIGTYPE_p_p_Model() {
swigCPtr = 0;
}
protected static long getCPtr(SWIGTYPE_p_p_Model obj) {
return (obj == null) ? 0 : obj.swigCPtr;
}
}
So my questions are :
how can I use this class?
How can I make a
typemap
in Swig to get read ofSWIGTYPE_p_p
?
来源:https://stackoverflow.com/questions/21932242/swigtype-p-p-a-pointer-on-a-pointer-on-a-structure-from-c-c-to-java