|
CPlusPlus
C++ support in BridJ
Also read CurrentState and TypeMapping for more details. Example of C++ classLet's use the following C++ class throughout this page : #ifdef _WIN32
# ifdef TEST_EXPORTS
# define TEST_API __declspec(dllexport)
# else
# define TEST_API __declspec(dllimport)
# endif
#elseif
# define TEST_API
#endif
class TEST_API TestClass {
public:
virtual ~TestClass();
virtual int testVirtualAdd(int a, int b);
};Its BridJ bindings are easy to write, but it is advised to use JNAerator to create them, nevertheless : import org.bridj.*;
import static org.bridj.Pointer.*;
public static class TestClass extends CPPObject {
@Virtual(0)
public native int testVirtualAdd(int a, int b);
};Runtime supportSupported compilers
Supported platformsAll of BridJ's supported platforms (see CurrentState). Language supportSupported features
TestClass test = new TestClass(); Pointer<TestClass> pTest = pointerTo(test); int result = test.testVirtualAdd(1, 2); And you can now derive from TestClass in Java very naturally :
Features not supported
... | |
► Sign in to add a comment