I haven't seen this anywhere (or maybe I'm jsut simple not seeing it) but is there a way to use JNI to return the c/c++ object and use that object in java?

For example (very simple):

class simpleClass{
...
private:
int intVar;
public:
int getIntVar();
void setIntVar(int someNum);
...
}

In my java code, how would I go about doing something like:

...
simpleClass sc = new simpleClass();
sc.setIntVar(9);
System.out.println(sc.getIntVar());
...

I realize this is a VERY simplistic example but I'm just looking for concept - the class I have in mind that is in c++ is very large and am looking to avoid creating a TON of wrapper methods...

If it's not possible that's fine, just hoping to save a few days coding lol

Edit
Report