I just read the following section of the "SWIG and Python" tutorial: http://www.swig.org/Doc1.1/HTML/Python.html#n11
I understand what they do in the example, basically you write a C function that calls python. However, the example provided takes only a double in the argument list, making it rather trivial to build an argument list for python.
I have a C++ callback that has the following signature:
Vector (*CALLBACK)(Simulation*, Vector, Vector, double, void*)
where Vector and Simulation are my own classes, and void* is for clientData holding a PyObject (as used in the example)
I know that SWIG wraps both the Vector and Simulation classes, because I can create them in a python shell. The only problem is, I have no idea how to transform a Vector argument in the callback function to an appropriate PyObject for the python argument list. SWIG obviously has some way to do this when it wraps the class itself, but I don't know how to accomplish it manually in the function.
Any help much appreciated! -Chase