GlueGen: com.jogamp.gluegen.procaddress.ProcAddressEmitter Class Reference

GlueGen v2.6.0-rc-20250822 GlueGen, Native Binding Generator for Java™ (public API).

Public Member Functions | Static Public Attributes | Protected Member Functions | Protected Attributes | Static Protected Attributes | List of all members
com.jogamp.gluegen.procaddress.ProcAddressEmitter Class Reference

A subclass of JavaEmitter that modifies the normal emission of C and Java code to allow dynamic lookups of the C entry points associated with the Java methods. More...

Inheritance diagram for com.jogamp.gluegen.procaddress.ProcAddressEmitter:
Collaboration diagram for com.jogamp.gluegen.procaddress.ProcAddressEmitter:

## Public Member Functions

void | beginFunctions (final TypeDictionary typedefDictionary, final TypeDictionary structDictionary, final Map< Type, Type > canonMap, final List< FunctionSymbol > cFunctions) throws Exception
void | endFunctions () throws Exception
void | beginStructs (final TypeDictionary typedefDictionary, final TypeDictionary structDictionary, final Map< Type, Type > canonMap) throws Exception
String | runtimeExceptionType ()
String | unsupportedExceptionType ()
Public Member Functions inherited from com.jogamp.gluegen.JavaEmitter
| JavaEmitter ()
| JavaEmitter (final JavaConfiguration cfg)
void | readConfigurationFile (final String filename) throws Exception
JavaConfiguration | getConfig ()
void | beginEmission (final GlueEmitterControls controls) throws IOException
| Begin the emission of glue code. More...
void | endEmission ()
| Finish the emission of glue code. More...
void | beginDefines () throws Exception
void | emitDefine (final ConstantDefinition def, final String optionalComment) throws Exception
void | endDefines () throws Exception
void | beginFunctions (final TypeDictionary typedefDictionary, final TypeDictionary structDictionary, final Map< Type, Type > canonMap, final List< FunctionSymbol > cFunctions) throws Exception
Iterator< FunctionSymbol > | emitFunctions (final List< FunctionSymbol > funcsToBind) throws Exception
| Emit glue code for the list of FunctionSymbols. More...
void | endFunctions () throws Exception
void | beginStructLayout () throws Exception
| Begins the process of computing field offsets and type sizes for the structs to be emitted. More...
void | layoutStruct (final CompoundType t) throws Exception
| Lays out one struct which will be emitted later. More...
void | endStructLayout () throws Exception
| Finishes the struct layout process. More...
void | beginStructs (final TypeDictionary typedefDictionary, final TypeDictionary structDictionary, final Map< Type, Type > canonMap) throws Exception
void | emitStruct (final CompoundType structCType, final Type structCTypedefPtr) throws Exception
| Emit glue code for the given CompoundType. More...
void | endStructs () throws Exception
String[] | getClassAccessModifiers (final String classFQName)
void | readConfigurationFile (String filename) throws Exception
JavaConfiguration | getConfig ()
void | beginEmission (GlueEmitterControls controls) throws Exception
| Begin the emission of glue code. More...
void | endEmission () throws Exception
| Finish the emission of glue code. More...
void | beginDefines () throws Exception
void | emitDefine (ConstantDefinition def, String optionalComment) throws Exception
void | endDefines () throws Exception
void | beginFunctions (TypeDictionary typedefDictionary, TypeDictionary structDictionary, Map< Type, Type > canonMap, List< FunctionSymbol > cFunctions) throws Exception
Iterator< FunctionSymbol > | emitFunctions (List< FunctionSymbol > cFunctions) throws Exception
| Emit glue code for the list of FunctionSymbols. More...
void | endFunctions () throws Exception
void | beginStructLayout () throws Exception
| Begins the process of computing field offsets and type sizes for the structs to be emitted. More...
void | layoutStruct (CompoundType t) throws Exception
| Lays out one struct which will be emitted later. More...
void | endStructLayout () throws Exception
| Finishes the struct layout process. More...
void | beginStructs (TypeDictionary typedefDictionary, TypeDictionary structDictionary, Map< Type, Type > canonMap) throws Exception
void | emitStruct (CompoundType t, Type typedefType) throws Exception
| Emit glue code for the given CompoundType. More...
void | endStructs () throws Exception

## Static Public Attributes

static final String | PROCADDRESS_VAR_PREFIX = "_addressof_"
| Must be synchronized w/ ProcAddressTable.PROCADDRESS_VAR_PREFIX !!! More...

## Protected Member Functions

JavaConfiguration | createConfig ()
| Create the object that will read and store configuration information for this JavaEmitter. More...
List<? extends FunctionEmitter > | generateMethodBindingEmitters (final FunctionSymbol sym) throws Exception
| Generate all appropriate Java bindings for the specified C function symbols. More...
boolean | needsModifiedEmitters (final FunctionSymbol sym)
String | getFunctionPointerTypedefName (final FunctionSymbol sym)
| Returns the name of the typedef for a pointer to the function represented by the argument as defined by the ProcAddressNameExpr in the .cfg file. More...
void | fixSecurityModifiers (final JavaMethodBindingEmitter javaEmitter)
| If 'native', enforce 'private native' modifiers. More...
void | generateModifiedEmitters (final JavaMethodBindingEmitter baseJavaEmitter, final List< FunctionEmitter > emitters)
void | generateModifiedEmitters (final CMethodBindingEmitter baseCEmitter, final List< FunctionEmitter > emitters)
boolean | callThroughProcAddress (final FunctionSymbol sym)
boolean | hasFunctionPointerTypedef (final FunctionSymbol sym)
void | beginProcAddressTable () throws Exception
void | endProcAddressTable () throws Exception
void | emitProcAddressTableEntryForString (final String str)
ProcAddressConfiguration | getProcAddressConfig ()
Protected Member Functions inherited from com.jogamp.gluegen.JavaEmitter
JavaConfiguration | createConfig ()
| Create the object that will read and store configuration information for this JavaEmitter. More...
void | generatePublicEmitters (final MethodBinding binding, final List< FunctionEmitter > allEmitters, final boolean signatureOnly)

Generates the public emitters for this MethodBinding which will produce either simply signatures (for the interface class, if any) or function definitions with or without a body (depending on whether or not the implementing function can go directly to native code because it doesn't need any processing of the outgoing arguments). More...

void | generatePrivateEmitters (final MethodBinding binding, final List< FunctionEmitter > allEmitters)
| Generates the private emitters for this MethodBinding. More...
void | prepCEmitter (final String returnSizeLookupName, final JavaType javaReturnType, final CMethodBindingEmitter cEmitter)
List<? extends FunctionEmitter > | generateMethodBindingEmitters (final FunctionSymbol sym) throws Exception
| Generate all appropriate Java bindings for the specified C function symbols. More...
CCodeUnit | openCUnit (final String filename, final String cUnitName) throws IOException
JavaCodeUnit | openJavaUnit (final String filename, final String packageName, final String simpleClassName) throws IOException
JavaCodeUnit | javaUnit ()
JavaCodeUnit | javaImplUnit ()
CCodeUnit | cUnit ()
String | getJavaOutputDir ()
| Returns the value that was specified by the configuration directive "JavaOutputDir", or the default if none was specified. More...
String | getJavaPackageName ()
| Returns the value that was specified by the configuration directive "Package", or the default if none was specified. More...
String | getImplPackageName ()
| Returns the value that was specified by the configuration directive "ImplPackage", or the default if none was specified. More...
void | emitCustomJavaCode (final CodeUnit unit, final String className) throws Exception
| Emit all the strings specified in the "CustomJavaCode" parameters of the configuration file. More...
void | emitCustomJNICode (final CodeUnit unit, final String className) throws Exception
| Emit all the strings specified in the "CustomJNICode" parameters of the configuration file. More...
void | emitAllFileHeaders () throws IOException
| Write out any header information for the output files (class declaration and opening brace, import statements, etc). More...
void | emitAllFileFooters ()
| Write out any footer information for the output files (closing brace of class definition, etc). More...
void | mangleBinding (final MethodBinding binding)
| Allow specializations to modify the given `MethodBinding` before `expanding` and emission. More...
List< MethodBinding > | expandMethodBinding (final MethodBinding binding)

## Protected Attributes

JavaCodeUnit | tableJavaUnit
Set< String > | emittedTableEntries
String | tableClassPackage
String | tableClassName
Protected Attributes inherited from com.jogamp.gluegen.JavaEmitter
JavaConfiguration | cfg
final LoggerIf | LOG

## Static Protected Attributes

static final String | WRAP_PREFIX = "dispatch_"

## Additional Inherited Members

Static Public Member Functions inherited from com.jogamp.gluegen.JavaEmitter
static int | addStrings2Buffer (StringBuilder buf, final String sep, final String first, final Collection< String > col)
Static Protected Member Functions inherited from com.jogamp.gluegen.JavaEmitter
static String | jniMangle (final String name)
| Mangle a class, package or function name for JNI usage, i.e. More...
static String | getJNIMethodNamePrefix (final String javaPackageName, final String javaClassName)
| Returns the JNI method prefix consisting our of mangled package- and class-name. More...

## Detailed Description

A subclass of JavaEmitter that modifies the normal emission of C and Java code to allow dynamic lookups of the C entry points associated with the Java methods.

Definition at line 69 of file ProcAddressEmitter.java.

## Member Function Documentation

## ◆ beginFunctions()

void com.jogamp.gluegen.procaddress.ProcAddressEmitter.beginFunctions | ( | final TypeDictionary | typedefDictionary,
|  | final TypeDictionary | structDictionary,
|  | final Map< Type, Type > | canonMap,
|  | final List< FunctionSymbol > | cFunctions
| ) |  | throws Exception

Reimplemented from com.jogamp.gluegen.JavaEmitter.

Definition at line 81 of file ProcAddressEmitter.java.

Here is the call graph for this function:

## ◆ beginProcAddressTable()

void com.jogamp.gluegen.procaddress.ProcAddressEmitter.beginProcAddressTable | ( |  | ) | throws Exception

protected

Definition at line 296 of file ProcAddressEmitter.java.

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ beginStructs()

void com.jogamp.gluegen.procaddress.ProcAddressEmitter.beginStructs | ( | final TypeDictionary | typedefDictionary,
|  | final TypeDictionary | structDictionary,
|  | final Map< Type, Type > | canonMap
| ) |  | throws Exception

Reimplemented from com.jogamp.gluegen.JavaEmitter.

Definition at line 100 of file ProcAddressEmitter.java.

## ◆ callThroughProcAddress()

boolean com.jogamp.gluegen.procaddress.ProcAddressEmitter.callThroughProcAddress | ( | final FunctionSymbol | sym | ) |

protected

Definition at line 270 of file ProcAddressEmitter.java.

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ createConfig()

JavaConfiguration com.jogamp.gluegen.procaddress.ProcAddressEmitter.createConfig | ( |  | ) |

protected

Create the object that will read and store configuration information for this JavaEmitter.

Reimplemented from com.jogamp.gluegen.JavaEmitter.

Definition at line 113 of file ProcAddressEmitter.java.

## ◆ emitProcAddressTableEntryForString()

void com.jogamp.gluegen.procaddress.ProcAddressEmitter.emitProcAddressTableEntryForString | ( | final String | str | ) |

protected

Definition at line 354 of file ProcAddressEmitter.java.

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ endFunctions()

void com.jogamp.gluegen.procaddress.ProcAddressEmitter.endFunctions | ( |  | ) | throws Exception

Reimplemented from com.jogamp.gluegen.JavaEmitter.

Definition at line 92 of file ProcAddressEmitter.java.

Here is the call graph for this function:

## ◆ endProcAddressTable()

void com.jogamp.gluegen.procaddress.ProcAddressEmitter.endProcAddressTable | ( |  | ) | throws Exception

protected

Definition at line 348 of file ProcAddressEmitter.java.

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ fixSecurityModifiers()

void com.jogamp.gluegen.procaddress.ProcAddressEmitter.fixSecurityModifiers | ( | final JavaMethodBindingEmitter | javaEmitter | ) |

protected

If 'native', enforce 'private native' modifiers.

Definition at line 189 of file ProcAddressEmitter.java.

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ generateMethodBindingEmitters()

List<? extends FunctionEmitter > com.jogamp.gluegen.procaddress.ProcAddressEmitter.generateMethodBindingEmitters | ( | final FunctionSymbol | sym | ) | throws Exception

protected

Generate all appropriate Java bindings for the specified C function symbols.

Reimplemented from com.jogamp.gluegen.JavaEmitter.

Definition at line 118 of file ProcAddressEmitter.java.

## ◆ generateModifiedEmitters() [1/2]

void com.jogamp.gluegen.procaddress.ProcAddressEmitter.generateModifiedEmitters | ( | final CMethodBindingEmitter | baseCEmitter,
|  | final List< FunctionEmitter > | emitters
| ) |  |

protected

Definition at line 241 of file ProcAddressEmitter.java.

Here is the call graph for this function:

## ◆ generateModifiedEmitters() [2/2]

void com.jogamp.gluegen.procaddress.ProcAddressEmitter.generateModifiedEmitters | ( | final JavaMethodBindingEmitter | baseJavaEmitter,
|  | final List< FunctionEmitter > | emitters
| ) |  |

protected

Definition at line 201 of file ProcAddressEmitter.java.

Here is the call graph for this function:

## ◆ getFunctionPointerTypedefName()

String com.jogamp.gluegen.procaddress.ProcAddressEmitter.getFunctionPointerTypedefName | ( | final FunctionSymbol | sym | ) |

protected

Returns the name of the typedef for a pointer to the function represented by the argument as defined by the ProcAddressNameExpr in the .cfg file.

For example, in the OpenGL headers, if the argument is the function "glFuncName", the value returned will be "PFNGLFUNCNAMEPROC". This returns a valid string regardless of whether or not the typedef is actually defined.

Definition at line 180 of file ProcAddressEmitter.java.

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ getProcAddressConfig()

ProcAddressConfiguration com.jogamp.gluegen.procaddress.ProcAddressEmitter.getProcAddressConfig | ( |  | ) |

protected

Definition at line 367 of file ProcAddressEmitter.java.

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ hasFunctionPointerTypedef()

boolean com.jogamp.gluegen.procaddress.ProcAddressEmitter.hasFunctionPointerTypedef | ( | final FunctionSymbol | sym | ) |

protected

Definition at line 289 of file ProcAddressEmitter.java.

Here is the call graph for this function:
Here is the caller graph for this function:

## ◆ needsModifiedEmitters()

boolean com.jogamp.gluegen.procaddress.ProcAddressEmitter.needsModifiedEmitters | ( | final FunctionSymbol | sym | ) |

protected

Definition at line 122 of file ProcAddressEmitter.java.

Here is the call graph for this function:

## ◆ runtimeExceptionType()

String com.jogamp.gluegen.procaddress.ProcAddressEmitter.runtimeExceptionType | ( |  | ) |

Definition at line 104 of file ProcAddressEmitter.java.

Here is the call graph for this function:

## ◆ unsupportedExceptionType()

String com.jogamp.gluegen.procaddress.ProcAddressEmitter.unsupportedExceptionType | ( |  | ) |

Definition at line 108 of file ProcAddressEmitter.java.

Here is the call graph for this function:
Here is the caller graph for this function:

## Member Data Documentation

## ◆ emittedTableEntries

Set<String> com.jogamp.gluegen.procaddress.ProcAddressEmitter.emittedTableEntries

protected

Definition at line 76 of file ProcAddressEmitter.java.

## ◆ PROCADDRESS_VAR_PREFIX

final String com.jogamp.gluegen.procaddress.ProcAddressEmitter.PROCADDRESS_VAR_PREFIX = "_addressof_"

static

Must be synchronized w/ ProcAddressTable.PROCADDRESS_VAR_PREFIX !!!

Definition at line 72 of file ProcAddressEmitter.java.

## ◆ tableClassName

String com.jogamp.gluegen.procaddress.ProcAddressEmitter.tableClassName

protected

Definition at line 78 of file ProcAddressEmitter.java.

## ◆ tableClassPackage

String com.jogamp.gluegen.procaddress.ProcAddressEmitter.tableClassPackage

protected

Definition at line 77 of file ProcAddressEmitter.java.

## ◆ tableJavaUnit

JavaCodeUnit com.jogamp.gluegen.procaddress.ProcAddressEmitter.tableJavaUnit

protected

Definition at line 75 of file ProcAddressEmitter.java.

## ◆ WRAP_PREFIX

final String com.jogamp.gluegen.procaddress.ProcAddressEmitter.WRAP_PREFIX = "dispatch_"

staticprotected

Definition at line 73 of file ProcAddressEmitter.java.

The documentation for this class was generated from the following file:

- src/java/com/jogamp/gluegen/procaddress/ProcAddressEmitter.java