40package com.jogamp.gluegen.procaddress;
42import com.jogamp.gluegen.MethodBinding;
43import com.jogamp.gluegen.FunctionEmitter;
44import com.jogamp.gluegen.JavaMethodBindingEmitter;
73 throw new IllegalArgumentException(
74 "Cannot create proc. address wrapper; method has containing type: \""
86 final String res = super.getImplName();
88 return ProcAddressEmitter.WRAP_PREFIX + res;
95 int numEmitted = super.appendArguments(buf);
102 buf.append(
"long procAddress");
111 final String name = super.getNativeImplMethodName();
113 return ProcAddressEmitter.WRAP_PREFIX + name;
120 super.emitPreCallSetup(
binding);
123 final String procAddressVariable = ProcAddressEmitter.PROCADDRESS_VAR_PREFIX +
binding.
getNativeName();
126 unit.
emitf(
" throw new %s(String.format(\"Method \\\"%%s\\\" not available\", \"%s\"));%n",
134 int numEmitted = super.emitCallArguments(
binding);
136 if (numEmitted > 0) {
151 writer.print(
"Entry point (through function pointer) to C language function: <br> ");
void emit(final String s)
void emitf(final String s, final Object... args)
Generic function emitter to produce C (JNI) or Java code stubs to its CodeUnit, invoking a native fun...
void setCommentEmitter(final CommentEmitter cEmitter)
Set the object that will emit the comment for this function.
final MethodBinding binding
final MethodBinding getBinding()
Emits the Java-side component (interface and.or implementation) of the Java<->C JNI binding to its Co...
Represents the binding of a C function to a Java method.
String getName()
Returns the FunctionSymbol's current aliased API name.
boolean hasContainingType()
Indicates whether this MethodBinding is for a function pointer contained in a struct,...
String getNativeName()
Returns the FunctionSymbol's name for the native function which is the original C API name per defaul...
A subclass of JavaEmitter that modifies the normal emission of C and Java code to allow dynamic looku...
String unsupportedExceptionType()
A specialization of JavaMethodBindingEmitter with knowledge of how to call through a function pointer...
String getProcAddressTableExpr
boolean changeNameAndArguments
String getNativeImplMethodName()
void emitPreCallSetup(final MethodBinding binding)
ProcAddressEmitter emitter
ProcAddressJavaMethodBindingEmitter(final JavaMethodBindingEmitter methodToWrap, final boolean callThroughProcAddress, final String getProcAddressTableExpr, final boolean changeNameAndArguments, final ProcAddressEmitter emitter)
int emitCallArguments(final MethodBinding binding)
int appendArguments(final StringBuilder buf)
Returns the number of arguments emitted.
ProcAddressJavaMethodBindingEmitter(final ProcAddressJavaMethodBindingEmitter methodToWrap)
boolean callThroughProcAddress