How to wrap c++ primitives using non-primitive java objects? #728
Answered
by
saudet
dhruvthanki
asked this question in
Q&A
-
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.
Answered by
saudet
Nov 25, 2023
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.
0 replies
Answer selected by
dhruvthanki
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can add additional pure Java wrappers for this purpose. There are tools like JavaPoet for that.