What is the difference between @MemberGetter
and @ValueGetter
annotations in JavaCPP
?
What are the use cases for them?
I have C header file with two constants
static const int TRANSPOSE = 0;
static const int NO_TRANSPOSE = 1;
What is the prefferred way to get their values at Java side?
UPDATE:
I've read JavaCPP Generator source code, done some experiments and ended up doing this in both ways and both are working. Here's java sample (see our github project for more).
private static native @MemberGetter @Const int TRANSPOSE();
private static native @ValueGetter @Const int NO_TRANSPOSE();
But I still do not know what are the differences. Both annotations produced same C++ code.
JNIEXPORT jint JNICALL Java_com_rtbhouse_model_natives_NeuralNetworkNativeOps_TRANSPOSE(JNIEnv* env, jclass cls) {
jint rarg = 0;
const int rvalue = (const int)TRANSPOSE;
rarg = (jint)rvalue;
return rarg;
}
JNIEXPORT jint JNICALL Java_com_rtbhouse_model_natives_NeuralNetworkNativeOps_NO_1TRANSPOSE(JNIEnv* env, jclass cls) {
jint rarg = 0;
const int rvalue = (const int)NO_TRANSPOSE;
rarg = (jint)rvalue;
return rarg;
}