| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
| |
instance is released before binding new one; Add test changing callback function.
|
| |
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
added code generation incl. native to Java dispatch and resource management
Tested via Test4JavaCallback.java (using test2.[hc]).
Please read the GlueGen_Mapping.md as well as Test4JavaCallback.java .
+++
Some implementation details:
JavaConfiguration maps JavaCallbackDef to JavaCallback set-function and maintains a list.
JavaCallbackDef itself holds all configured details.
JavaConfiguration also maps JavaCallbackInfo to JavaCallback set-function.
JavaCallbackInfo itself holds all compile time information, as produced by JavaEmitter.beginFunctions(..).
This extends JavaCallbackDef and avoid repetetive computation for the callback-function-type and its MethodBinding,
parameter indices for the callback interface and userParam, etc.
CMethodBindingEmitter: Native callback to Java dispatch
- The JavaCallback setter function creates a native 'UserParam' struct instance,
which holds the callback-interface-jobject, its callback-jmethodID and
the userParam-jobject for invocation of the actual JavaCallback interface method.
- To produce the C-Type -> JNI-Type conversion, An internal CMethodBindingEmitter instance
for the native-callback function binding is created inside the CMethodBindingEmitter of the callback setter method.
It is being used to map the types to JNI within the generated native callback function,
passed to the actual JavaCallback method.
JavaMethodBindingEmitter: Native callback to Java dispatch
- The JavaCallbacl setter passes the callback-interface-object, the userParam-object and the
callback-method-signature (to have the native method retrieve the jmethodID).
- It receives the native pointer of the native `UserParam` struct instance,
which gets mapped to the userParam-object. (*TODO: Refine ownership + release*).
|
|
|
|
| |
additional params if produced name containes '__', i.e. JNI mangled parameter
|
|
|
|
| |
drop 'void' and use typedef-name; MethodBinding: Add getCParameterList(..) and getJavaParameterList(..) for general usage similar to FunctionType.getParameterList()
|
|
|
|
| |
emitBodyMapCToJNIType(): Reuse to converting any C-type argument to java JNI type (i.e. native callback to JavaCallback)
|
| |
|
|
|
|
| |
`JNI_OnLoad_<LibraryBasename>(..)` for static libraries and `JVMUtil_GetJNIEnv(..)` to resolve the `JNIEnv*` as used by JavaCallback
|
|
|
|
| |
section for it
|
|
|
|
|
|
| |
`Opaque` configured pointer-types
.. includes cross-ref'ed doc and unit test
|
|
|
|
| |
pass value at invocation, allowing to find the jmethodID of callback
|
|
|
|
| |
across *Emitter (needed for CMethodEmitter as well); Add JavaCallback.methodSignature to be passed to native function later on to find the callback jmethodID
|
|
|
|
| |
names, used in CMethodBindingEmitter; Use JavaCallback's function-pointer-type capital-name as simple-class-name and its FQN for JNI resolution.
|
|
|
|
|
|
|
|
|
|
|
|
| |
generated callback interface mapping the callback function.
This passes the jobject for the callback function/interface and the userParam (from 'void*')
down to the native implementation.
TODO: Add specific native implementation for JavaCallback,
wrapping the jobject's into a native struct as user-param
and a universal C-function as the native callback to dispatch
the call to the java method with known arguments.
|
|
|
|
|
|
|
|
|
|
| |
generated or existing) Class objects (existing at runtime)
New nature can be queried via isNamedClass().
Cleaned up equals() and completed hashValue() etc.
Ctor validation ensures exactly one nature is set!
|
| |
|
|
|
|
|
|
| |
interfaces, TODO implementation
Note: JavaCallbackDef is commented out on test2.cfg example, since implementation is missing.
|
|
|
|
| |
AliasedSymbol symbol)
|
|
|
|
|
|
|
|
|
| |
<funcion-pointer-typedef-name> [user-param-idx]'
Define a JavaCallback, enacted on a function-pointer argument `T2_CallbackFunc` and a user-param `void*` for Java Object mapping
Example:
JavaCallbackDef T2_CallbackFunc 2
|
|
|
|
| |
via type(def)name, ctor: addAliasedName( type.getCName() )
|
| |
|
| |
|
|
|
|
| |
elaborate on FunctionType as getTargetType() only retruns a function-ptr and no more a function-type.
|
|
|
|
| |
where it could occur -> non-opaque, non-primitive array case
|
| |
|
|
|
|
| |
renamed {jniMangle->getJNIMangledArg}(..)
|
|
|
|
| |
JavaEmitter.getConfig(), cleaning up API usage
|
|
|
|
| |
to be reusable
|
|
|
|
| |
See documentation and unit test test2.h, Test2FuncPtr.java and Test3PtrStorage.java
|
|
|
|
| |
i.e. only pass numPointersStripped w/o adding info.pointerDepth()
|
| |
|
|
|
|
|
|
|
|
|
|
| |
enhance API doc; Add getArrayBaseOrPointerTargetType() and getTargetFunction()
Added getArrayBaseOrPointerTargetType() returns getBaseType() for arrays or getTargetType() for pointer,
i.e. stops traversing if an elementType is a pointer and returns the elementType as target-type.
This resolves 'int* intPtrArray[10]', but also simplifies all cases of 'int** intPtrPtr' and 'int intPtr[10]' etc.
Since get{Base,Target}Type() returns the functionPointer, getTargetFunction() allows to retrieve the actual target function type.
|
| |
|
|
|
|
|
|
|
|
| |
Arrange wrap/deref arguments equal; Add equal set of absolute get/set methods
Completing API to simplify usage by generated code.
All absolute get/set method check arguments itself and against limit(), allow to drop checks in generated code (size).
|
| |
|
|
|
|
| |
remove '"' in message
|
| |
|
|
|
|
| |
get<FuncName>()
|
|
|
|
| |
documentation
|
|
|
|
| |
Table' and add a brief signature to mapping description to the former
|
|
|
|
| |
getElementType(); Rename getBase{Elem ->}Type() to align with getTargetType()
|
|
|
|
| |
GlueGen_Mapping document
|
| |
|
|
|
|
| |
Completing a few cases and fix some signatures in table
|
|
|
|
| |
enabled by default
|
|\
| |
| |
| | |
'Mathieu_Fery/feature/add_preserveGeneratedCPP_option'
|