Is it possible to access the properties or methods of C++ objects created with LibraryLink or MathLink like with J/Link ? Such capability doesn't seem built-in yet and I'm not sure it ever will as Java has introspection capabilities (the ability to retrieve information about classes' members) that I'm not sure C++ has. But maybe I'm wrong ?
No, it is not possible, without creating a custom C++ compiler with enhanced run-time which would support reflection, because C++ does not have a reflection API (JLink capability of accessing properties or methods is based on Java Reflection). There are some libraries / attempts to provide reflection-like functionality to C++, but all of them are (AFAIK) fundamentally limited (e.g. compile-time reflection) and incomplete (I am not even sure that full-fledged and reliable run-time reflection can be achieved without automatic garbage collection, even in principle - and C++ is not a garbage-collected language).
You may have better luck with the D language, which seems to have some reflection capabilities (I don't have experience with it). AFAIK, D can transparently interoperate with C/C++, in particular consume any C++ library without extra wrappers. But this is of course not the same as run-time reflection.
As another, and IMO, very interesting option, you can embed JVM into your application via JNI (Java Native Interface), in which case, you should be able to use Java from LibraryLink, without much performance overhead, since the JVM will then be the same process with the kernel. This option, of course, won't help you if you need to use existing C++ libraries (although, many of them have been ported to Java, so it may make sense to check that). Also, this option would still require custom code.
Apart from these technical obstacles, note alse that JLink does much more than MathLink or LibraryLink: the existence of reflection allows it to know which methods / fields a given class has, at run-time. So, what it does, when you call
|show 2 more comments|