|
GlueGen v2.6.0-rc-20250712
GlueGen, Native Binding Generator for Java (public API).
|
Represents the binding of a C function to a Java method. More...
Classes | |
| interface | ParameterConsumer |
forEachParameter(ParameterConsumer) Consumer More... | |
Public Member Functions | |
| MethodBinding (final MethodBinding bindingToCopy) | |
| Constructs a new MethodBinding that is an exact clone of the argument, including the java return type and java argument types. More... | |
| MethodBinding (final FunctionSymbol sym, final String delegationImplName, final JavaType javaReturnType, final List< JavaType > javaArgumentTypes, final JavaType containingType, final Type containingCType) | |
| Constructor for calling a C function or a function pointer contained in a struct. More... | |
| void | setJavaReturnType (final JavaType type) |
| void | addJavaArgumentType (final JavaType type) |
| JavaType | getJavaReturnType () |
| int | getNumArguments () |
| JavaType | getJavaArgumentType (final int i) |
| Type | getCReturnType () |
| Type | getCArgumentType (final int i) |
| StringBuilder | getCParameterList (final StringBuilder buf, final boolean useTypedef, final String callingConvention) |
| Returns the function parameter list, i.e. More... | |
| StringBuilder | getCParameterList (final StringBuilder buf, final boolean useTypedef, final String callingConvention, final List< Integer > exclude) |
| Returns the function parameter list, i.e. More... | |
| StringBuilder | getJavaParameterList (final StringBuilder buf) |
| Returns the function parameter list, i.e. More... | |
| StringBuilder | getJavaParameterList (final StringBuilder buf, final List< Integer > exclude) |
| Returns the function parameter list, i.e. More... | |
| StringBuilder | getJavaSelectParameter (final StringBuilder buf, final List< Integer > include, final boolean addTailSeparator) |
| Returns the function parameter list, i.e. More... | |
| StringBuilder | getJavaCallArgumentList (final StringBuilder buf, final List< Integer > exclude) |
| StringBuilder | getJavaCallSelectArguments (final StringBuilder buf, final List< Integer > include, final boolean addTailSeparator) |
| int | forEachParameter (final ParameterConsumer c) |
| final boolean | isReturnCompoundByValue () |
| FunctionSymbol | getCSymbol () |
Returns the FunctionSymbol. More... | |
| String | getArgumentName (final int i) |
| Returns either the argument name specified by the underlying FunctionSymbol or a fabricated argument name based on the position. More... | |
| String | getName () |
Returns the FunctionSymbol's current aliased API name. More... | |
| String | getDelegationImplName () |
The implementation delegation name, or null for no delegation. More... | |
| String | getInterfaceName () |
Returns the FunctionSymbol's current aliased API name for the interface. More... | |
| String | getImplName () |
Returns the FunctionSymbol's name for the implementation, which is the current aliased API name per default, or the delegation name. More... | |
| String | getNativeName () |
Returns the FunctionSymbol's name for the native function which is the original C API name per default, but may be overridden via setNativeName(String). More... | |
| void | setNativeName (final String s) |
| MethodBinding | replaceJavaArgumentType (final int argumentNumber, final JavaType newArgType) |
| Creates a new MethodBinding replacing the specified Java argument type with a new argument type. More... | |
| boolean | argumentsUseNIO () |
| Returns true if any of the outgoing arguments in the method's signature require conversion or checking due to the use of New I/O. More... | |
| boolean | signatureUsesNIO () |
| Returns true if the return type or any of the outgoing arguments in the method's signature require conversion or checking due to the use of New I/O. More... | |
| boolean | signatureCanUseIndirectNIO () |
| Returns true if it is possible for any of the outgoing arguments to be indirect NIO buffers. More... | |
| boolean | signatureUsesCompoundTypeWrappers () |
| Returns true if the return type or any of the outgoing arguments in the method's signature use "compound type wrappers", or NIO-based wrappers for C data structures. More... | |
| boolean | signatureUsesArraysOfCompoundTypeWrappers () |
| Returns true if the return type or any of the outgoing arguments in the method's signature use arrays of "compound type wrappers", or NIO-based wrappers for C data structures. More... | |
| boolean | needsNIOWrappingOrUnwrapping () |
| Returns true if the function needs NIO-related wrapping/unwrapping or conversion of various arguments. More... | |
| boolean | signatureUsesCVoidPointers () |
| Returns true if the return type or any of the outgoing arguments in the method's signature represent C void* pointers. More... | |
| boolean | signatureUsesCPrimitivePointers () |
| Returns true if the return type or any of the outgoing arguments in the method's signature represent C primitive pointers. More... | |
| boolean | signatureUsesCArrays () |
| Returns true if the return type or any of the outgoing arguments in the method's signature represent C arrays. More... | |
| boolean | signatureUsesJavaPrimitiveArrays () |
| Returns true if the return type or any of the outgoing arguments in the method's signature represent Java primitive arrays. More... | |
| boolean | hasContainingType () |
| Indicates whether this MethodBinding is for a function pointer contained in a struct, or to access array- or pointer-data from a struct. More... | |
| JavaType | getContainingType () |
| Retrieves the containing type of this MethodBinding if it is for a function pointer contained in a struct. More... | |
| Type | getContainingCType () |
| Retrieves the containing C type of this MethodBinding if it is for a function pointer contained in a struct. More... | |
| void | findThisPointer () |
| Find the leftmost argument matching the type of the containing type (for function pointer MethodBindings) and record that as a "this" pointer, meaning that it does not need to be explicitly passed at the Java level. More... | |
| void | clearThisPointer () |
| Clears any record of a this pointer for this MethodBinding. More... | |
| boolean | isArgumentThisPointer (final int i) |
| Indicates whether the ith argument to this MethodBinding is actually a "this" pointer. More... | |
| boolean | equals (final Object obj) |
| int | hashCode () |
| String | toString () |
| Returns the signature of this binding. More... | |
| String | getDescriptor (final boolean forImplementingMethodCall, final boolean eraseBufferAndArrayTypes) |
| Returns a String containing the descriptor (signature in internal format) of this MethodBinding as it will be emitted. More... | |
Protected Member Functions | |
| void | computeSignatureProperties () |
| Computes summary information about the method's C and Java signatures. More... | |
| String | erasedTypeDescriptor (final JavaType type, final boolean eraseBufferAndArrayTypes, final boolean skipBuffers) |
Represents the binding of a C function to a Java method.
Also used to represent calls through function pointers contained in structs.
Definition at line 54 of file MethodBinding.java.
| com.jogamp.gluegen.MethodBinding.MethodBinding | ( | final MethodBinding | bindingToCopy | ) |
Constructs a new MethodBinding that is an exact clone of the argument, including the java return type and java argument types.
It's safe to modify this binding after construction.
Definition at line 80 of file MethodBinding.java.
| com.jogamp.gluegen.MethodBinding.MethodBinding | ( | final FunctionSymbol | sym, |
| final String | delegationImplName, | ||
| final JavaType | javaReturnType, | ||
| final List< JavaType > | javaArgumentTypes, | ||
| final JavaType | containingType, | ||
| final Type | containingCType | ||
| ) |
Constructor for calling a C function or a function pointer contained in a struct.
In case of the latter, a struct function pointer, the arguments containingType and containingCType must not be null!
Definition at line 109 of file MethodBinding.java.
| void com.jogamp.gluegen.MethodBinding.addJavaArgumentType | ( | final JavaType | type | ) |
| boolean com.jogamp.gluegen.MethodBinding.argumentsUseNIO | ( | ) |
Returns true if any of the outgoing arguments in the method's signature require conversion or checking due to the use of New I/O.
Definition at line 410 of file MethodBinding.java.
| void com.jogamp.gluegen.MethodBinding.clearThisPointer | ( | ) |
Clears any record of a this pointer for this MethodBinding.
Definition at line 650 of file MethodBinding.java.
|
protected |
Computes summary information about the method's C and Java signatures.
Definition at line 504 of file MethodBinding.java.
| boolean com.jogamp.gluegen.MethodBinding.equals | ( | final Object | obj | ) |
|
protected |
| void com.jogamp.gluegen.MethodBinding.findThisPointer | ( | ) |
Find the leftmost argument matching the type of the containing type (for function pointer MethodBindings) and record that as a "this" pointer, meaning that it does not need to be explicitly passed at the Java level.
Definition at line 634 of file MethodBinding.java.
| int com.jogamp.gluegen.MethodBinding.forEachParameter | ( | final ParameterConsumer | c | ) |
Definition at line 306 of file MethodBinding.java.
| String com.jogamp.gluegen.MethodBinding.getArgumentName | ( | final int | i | ) |
Returns either the argument name specified by the underlying FunctionSymbol or a fabricated argument name based on the position.
Note that it is currently not guaranteed that there are no namespace clashes with these fabricated argument names.
Definition at line 338 of file MethodBinding.java.
| Type com.jogamp.gluegen.MethodBinding.getCArgumentType | ( | final int | i | ) |
Definition at line 154 of file MethodBinding.java.
| Type com.jogamp.gluegen.MethodBinding.getContainingCType | ( | ) |
Retrieves the containing C type of this MethodBinding if it is for a function pointer contained in a struct.
Definition at line 626 of file MethodBinding.java.
| JavaType com.jogamp.gluegen.MethodBinding.getContainingType | ( | ) |
Retrieves the containing type of this MethodBinding if it is for a function pointer contained in a struct.
Definition at line 620 of file MethodBinding.java.
| StringBuilder com.jogamp.gluegen.MethodBinding.getCParameterList | ( | final StringBuilder | buf, |
| final boolean | useTypedef, | ||
| final String | callingConvention | ||
| ) |
Returns the function parameter list, i.e.
a comma separated list of argument type and name.
| buf | StringBuilder instance |
| useTypedef | if true and type is typedef'ed, use its name |
| callingConvention | optional calling-convention |
Definition at line 165 of file MethodBinding.java.
| StringBuilder com.jogamp.gluegen.MethodBinding.getCParameterList | ( | final StringBuilder | buf, |
| final boolean | useTypedef, | ||
| final String | callingConvention, | ||
| final List< Integer > | exclude | ||
| ) |
Returns the function parameter list, i.e.
a comma separated list of argument type and name.
| buf | StringBuilder instance |
| useTypedef | if true and type is typedef'ed, use its name |
| callingConvention | optional calling-convention |
| exclude | optional list of excluded parameter indices |
Definition at line 176 of file MethodBinding.java.
| Type com.jogamp.gluegen.MethodBinding.getCReturnType | ( | ) |
Definition at line 150 of file MethodBinding.java.
| FunctionSymbol com.jogamp.gluegen.MethodBinding.getCSymbol | ( | ) |
Returns the FunctionSymbol.
Definition at line 329 of file MethodBinding.java.
| String com.jogamp.gluegen.MethodBinding.getDelegationImplName | ( | ) |
The implementation delegation name, or null for no delegation.
Definition at line 356 of file MethodBinding.java.
| String com.jogamp.gluegen.MethodBinding.getDescriptor | ( | final boolean | forImplementingMethodCall, |
| final boolean | eraseBufferAndArrayTypes | ||
| ) |
Returns a String containing the descriptor (signature in internal format) of this MethodBinding as it will be emitted.
This is used to disambiguate between overloadings when manually specifying prologue and epilogue code, for example.
Definition at line 756 of file MethodBinding.java.
| String com.jogamp.gluegen.MethodBinding.getImplName | ( | ) |
Returns the FunctionSymbol's name for the implementation, which is the current aliased API name per default, or the delegation name.
Definition at line 370 of file MethodBinding.java.
| String com.jogamp.gluegen.MethodBinding.getInterfaceName | ( | ) |
Returns the FunctionSymbol's current aliased API name for the interface.
Definition at line 361 of file MethodBinding.java.
| JavaType com.jogamp.gluegen.MethodBinding.getJavaArgumentType | ( | final int | i | ) |
| StringBuilder com.jogamp.gluegen.MethodBinding.getJavaCallArgumentList | ( | final StringBuilder | buf, |
| final List< Integer > | exclude | ||
| ) |
| StringBuilder com.jogamp.gluegen.MethodBinding.getJavaCallSelectArguments | ( | final StringBuilder | buf, |
| final List< Integer > | include, | ||
| final boolean | addTailSeparator | ||
| ) |
Definition at line 274 of file MethodBinding.java.
| StringBuilder com.jogamp.gluegen.MethodBinding.getJavaParameterList | ( | final StringBuilder | buf | ) |
Returns the function parameter list, i.e.
a comma separated list of argument type and name.
| buf | StringBuilder instance |
Definition at line 213 of file MethodBinding.java.
| StringBuilder com.jogamp.gluegen.MethodBinding.getJavaParameterList | ( | final StringBuilder | buf, |
| final List< Integer > | exclude | ||
| ) |
Returns the function parameter list, i.e.
a comma separated list of argument type and name.
| buf | StringBuilder instance |
| exclude | optional list of excluded parameter indices |
Definition at line 222 of file MethodBinding.java.
| JavaType com.jogamp.gluegen.MethodBinding.getJavaReturnType | ( | ) |
| StringBuilder com.jogamp.gluegen.MethodBinding.getJavaSelectParameter | ( | final StringBuilder | buf, |
| final List< Integer > | include, | ||
| final boolean | addTailSeparator | ||
| ) |
Returns the function parameter list, i.e.
a comma separated list of argument type and name.
| buf | StringBuilder instance |
| include | list of explicit included parameter indices |
| addTailSeparator | add a comma separator in the end if result is not empty |
Definition at line 243 of file MethodBinding.java.
| String com.jogamp.gluegen.MethodBinding.getName | ( | ) |
Returns the FunctionSymbol's current aliased API name.
Definition at line 347 of file MethodBinding.java.
| String com.jogamp.gluegen.MethodBinding.getNativeName | ( | ) |
Returns the FunctionSymbol's name for the native function which is the original C API name per default, but may be overridden via setNativeName(String).
Definition at line 378 of file MethodBinding.java.
| int com.jogamp.gluegen.MethodBinding.getNumArguments | ( | ) |
Definition at line 142 of file MethodBinding.java.
| boolean com.jogamp.gluegen.MethodBinding.hasContainingType | ( | ) |
Indicates whether this MethodBinding is for a function pointer contained in a struct, or to access array- or pointer-data from a struct.
The native calling convention, i.e. via a 'this' function pointer or by a static native function must be decided in the JavaEmitter handling structs and passed to the CMethodBindingEmitter#setIsCStructFunctionPointer(boolean).
Definition at line 614 of file MethodBinding.java.
| int com.jogamp.gluegen.MethodBinding.hashCode | ( | ) |
| boolean com.jogamp.gluegen.MethodBinding.isArgumentThisPointer | ( | final int | i | ) |
Indicates whether the ith argument to this MethodBinding is actually a "this" pointer.
Definition at line 656 of file MethodBinding.java.
| final boolean com.jogamp.gluegen.MethodBinding.isReturnCompoundByValue | ( | ) |
Definition at line 317 of file MethodBinding.java.
| boolean com.jogamp.gluegen.MethodBinding.needsNIOWrappingOrUnwrapping | ( | ) |
Returns true if the function needs NIO-related wrapping/unwrapping or conversion of various arguments.
Currently this returns the logical OR of signatureUsesNIO(), signatureUsesCompoundTypeWrappers() and signatureUsesArraysOfCompoundTypeWrappers().
Definition at line 460 of file MethodBinding.java.
| MethodBinding com.jogamp.gluegen.MethodBinding.replaceJavaArgumentType | ( | final int | argumentNumber, |
| final JavaType | newArgType | ||
| ) |
Creates a new MethodBinding replacing the specified Java argument type with a new argument type.
If argumentNumber is less than 0 then replaces the return type.
Definition at line 386 of file MethodBinding.java.
| void com.jogamp.gluegen.MethodBinding.setJavaReturnType | ( | final JavaType | type | ) |
| void com.jogamp.gluegen.MethodBinding.setNativeName | ( | final String | s | ) |
Definition at line 381 of file MethodBinding.java.
| boolean com.jogamp.gluegen.MethodBinding.signatureCanUseIndirectNIO | ( | ) |
Returns true if it is possible for any of the outgoing arguments to be indirect NIO buffers.
Definition at line 429 of file MethodBinding.java.
| boolean com.jogamp.gluegen.MethodBinding.signatureUsesArraysOfCompoundTypeWrappers | ( | ) |
Returns true if the return type or any of the outgoing arguments in the method's signature use arrays of "compound type wrappers", or NIO-based wrappers for C data structures.
Definition at line 449 of file MethodBinding.java.
| boolean com.jogamp.gluegen.MethodBinding.signatureUsesCArrays | ( | ) |
Returns true if the return type or any of the outgoing arguments in the method's signature represent C arrays.
Definition at line 486 of file MethodBinding.java.
| boolean com.jogamp.gluegen.MethodBinding.signatureUsesCompoundTypeWrappers | ( | ) |
Returns true if the return type or any of the outgoing arguments in the method's signature use "compound type wrappers", or NIO-based wrappers for C data structures.
Definition at line 439 of file MethodBinding.java.
| boolean com.jogamp.gluegen.MethodBinding.signatureUsesCPrimitivePointers | ( | ) |
Returns true if the return type or any of the outgoing arguments in the method's signature represent C primitive pointers.
Definition at line 477 of file MethodBinding.java.
| boolean com.jogamp.gluegen.MethodBinding.signatureUsesCVoidPointers | ( | ) |
Returns true if the return type or any of the outgoing arguments in the method's signature represent C void* pointers.
Definition at line 468 of file MethodBinding.java.
| boolean com.jogamp.gluegen.MethodBinding.signatureUsesJavaPrimitiveArrays | ( | ) |
Returns true if the return type or any of the outgoing arguments in the method's signature represent Java primitive arrays.
Definition at line 495 of file MethodBinding.java.
| boolean com.jogamp.gluegen.MethodBinding.signatureUsesNIO | ( | ) |
Returns true if the return type or any of the outgoing arguments in the method's signature require conversion or checking due to the use of New I/O.
Definition at line 420 of file MethodBinding.java.
| String com.jogamp.gluegen.MethodBinding.toString | ( | ) |
Returns the signature of this binding.
Definition at line 719 of file MethodBinding.java.