I'm new here, so thanks for comments and advices. I hope I hit the correct list.
Problem:
I have two classes Graph and Node.
Now I want to realize the following
Java Code by Call from C++. I will not use callbacks, because later I want to write a wrapper library:
Graph g = new Graph();
Node A = g.addNode();
I do this to create the Graph Object in c++:
#include <jni.h>
#include <stdio.h>
#include <iostream>
#include "GraphTest.h"
JNIEXPORT jobject JNICALL Java_GraphTest_getGraph
(JNIEnv* env, jclass in_cls)
{
jclass jcls;
jmethodID jmid;
jobject jobj;
jcls = env->FindClass("Graph");
jmid = env->GetMethodID(jcls, "<init>","()V");
jobj = env->NewObject(jcls, jmid);
return jobj;
}
How can I realize the second Part [[Node A = g.addNode();]] in c++ now?
Many in thanks in advance
Parseval