Mercurial > hg > libxtract
diff swig/xtract.i @ 133:15bc88384ecd
Java SWIG bindings improvements
author | Jamie Bullock <jamie@postlude.co.uk> |
---|---|
date | Wed, 13 Jun 2012 15:08:11 +0100 |
parents | c8502708853b |
children | 5810fb03cacc |
line wrap: on
line diff
--- a/swig/xtract.i Sun Jun 10 12:11:15 2012 +0100 +++ b/swig/xtract.i Wed Jun 13 15:08:11 2012 +0100 @@ -1,6 +1,6 @@ %module xtract +%include typemaps.i %include carrays.i -%include typemaps.i %{ #include "xtract/xtract_scalar.h" @@ -17,9 +17,24 @@ %delobject destroy_filterbank; +%typemap(javabase) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], + SWIGTYPE (CLASS::*) "SWIG" + +%typemap(javacode) SWIGTYPE, SWIGTYPE *, SWIGTYPE &, SWIGTYPE [], + SWIGTYPE (CLASS::*) %{ + protected long getPointer() { + return swigCPtr; + } +%} + /* Helper functions */ %inline %{ + void *floata_to_voidp(float f[]) + { + return (void *)f; + } + xtract_function_descriptor_t *get_descriptor(xtract_function_descriptor_t *fd, int i){ @@ -86,7 +101,8 @@ %array_class(float, floatArray); %array_class(int, intArray); %apply float *OUTPUT { float *result }; -/* %apply float *INPUT { float *data }; */ +%apply float[] {const float *data}; + %ignore xtract;