dukeify / fake-jni

An implementation of the JNI and JVMTI with support for direct interaction between natively registered classes and JVM objects.
Other
28 stars 10 forks source link

Remove FakeJni::Field and FakeJni::Function for native class member registration #62

Open Matthewacon opened 5 years ago

Matthewacon commented 5 years ago

Right now you must use the Function<&MyClass::myFunction> {} and Field<&MyClass::myField> {} breeder templates to register members on a native class. This change was made to mitigate an issue with implicit conversions from static member function pointers to void * and the subsequent incorrect registration as a void * field. This can be properly mitigated using CX::IsFunction, without the API boilerplate of breeder templates.

Note: the Constructor<MyClass, [Args...]> {} breeder template is still required to register constructors for native classes.