How to wrap c++ primitives using non-primitive java objects? #728
-
Hello! New to java and javacpp. I have a c++ library with structs, each struct contains doubles and arrays of doubles, and functions that take and transform these structs. On the java side I have a customDouble and customDouble[] which have primitive double inside. I want to bind the c++ library so the exposed structs on the java contain customDouble and customDouble[]. I am not sure how I would go about doing this or even if its possible or not. Any help would be appreciated. Thank you! // cpp
struct product {
double price;
double quantity[3];
} ; // java
public class customDouble
{
private double value;
} // java wrapped c++
// something like
public class product {
customDouble price;
customDouble[] quatity;
} |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
You can add additional pure Java wrappers for this purpose. There are tools like JavaPoet for that. |
Beta Was this translation helpful? Give feedback.
You can add additional pure Java wrappers for this purpose. There are tools like JavaPoet for that.