I’m wrapping a C library that contains a struct:
struct SCIP
{
//...
}
and a function that creates such a struct:
void SCIPcreate(SCIP** s)
SWIG generates a python class SCIP and a function SCIPcreate(*args) from that.
When I now try calling SCIPcreate() in python, it obviously expects a parameter of type SCIP**, how am I supposed to create such a thing?
Or should I try and extend the SCIP class with a constructor that calls SCIPcreate() automatically? If so, how would I go about that?
Given the header file:
We can wrap this function using:
which is two typemaps, one to create a local, temporary pointer to be used as the input to the function and another to copy the value of the pointer after the call into the return.
As an alternative to this you could also use
%inlineto set an overload: