HELICS icon indicating copy to clipboard operation
HELICS copied to clipboard

Java API Function helicsSubscriptionGetVector has an incorrect signature.

Open afisher1 opened this issue 7 years ago • 2 comments

The current Java API Function helicsSubscriptionGetVector() has the following signature: public static helics_status helicsSubscriptionGetVector(SWIGTYPE_p_void sub, SWIGTYPE_p_double data, int maxlen, int[] actualSize)

If you look at the helicsSubscriptionSetDefaultVector and helicsPublicationPublishVector functions they do not use a SWIGTYPE_p_double data but a double[] data. I believe this is what needs to be used in this case.

afisher1 avatar Jun 11 '18 21:06 afisher1

@shwethanidd @afisher1 Did this get fixed in your update of the 2.0 branch for Java? Are you happy with how it is working now?

phlptp avatar Oct 29 '18 21:10 phlptp

No not fixed yet. For some reason, swig is not converting double [] properly. C/C++ signature is: HELICS_EXPORT void helicsInputGetVector (helics_input ipt, double data[], int maxlen, int *actualSize, helics_error *err); And java signature is: helicsInputGetVector(SWIGTYPE_p_void ipt, SWIGTYPE_p_double data, int maxlen, int[] actualSize)

shwethanidd avatar Oct 29 '18 22:10 shwethanidd