Es gibt doch zwei mir bekannte Möglichkeiten,
von Java aus auf C++ Klassen zuzugreifen:
1. Es gibt eine Facility bei VisualAge for Java v2.0
2. Von J2C++ aus:
What is J2C++?
J2C++ is a code generation tool that allows a Java applet or application to access C++ objects seamlessly by making them appear as if they were implemented in Java.
J2C++ parses a C++ definition file (e.g. an .hpp file) and generates a mapping layer consisting of Java source and C++ source which exploits the native method call
interface of the Java Virtual Machine (JVM).
A makefile builder (mkmake) simplifies the tasks required to build the generated source code. Both a Java compiler (javac) and C++ compiler are needed to build the mapping layer.
How does it work?
When the Java proxy class is used in a Java program, a one-to-one relationship is established between the proxy object and its corresponding C++ object.
When the proxy object is instantiated, its corresponding C++ object is also instantiated. In addition, when the JVM garbage collector frees a Java proxy object, the associated C++ object is removed as well.
J2C++ also supports C++ code that does not belong to a particular C++ class definition (i.e. overloaded nonmember operators, global functions and global variables).
J2C++ does have limitations due to the differences between C++ and Java. For example, J2C++ only supports single inheritance and does not support templates or member selection operators.
Hier kann man eine trial version laden(rechts oben):
http://www.alphaworks.ibm.com/tech/j2cpp
[ Leser: 19 ] |