Package com.jogamp.gluegen.procaddress
Class ProcAddressEmitter
- java.lang.Object
-
- com.jogamp.gluegen.JavaEmitter
-
- com.jogamp.gluegen.procaddress.ProcAddressEmitter
-
- All Implemented Interfaces:
GlueEmitter
public class ProcAddressEmitter extends JavaEmitter
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.
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.jogamp.gluegen.JavaEmitter
JavaEmitter.EmissionStyle, JavaEmitter.MethodAccess, JavaEmitter.Ownership
-
-
Field Summary
Fields Modifier and Type Field Description protected Set<String>emittedTableEntriesstatic StringPROCADDRESS_VAR_PREFIXMust be synchronized w/ ProcAddressTable.PROCADDRESS_VAR_PREFIX !!!protected StringtableClassNameprotected StringtableClassPackageprotected JavaCodeUnittableJavaUnitprotected static StringWRAP_PREFIX-
Fields inherited from class com.jogamp.gluegen.JavaEmitter
cfg, LOG
-
-
Constructor Summary
Constructors Constructor Description ProcAddressEmitter()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidbeginFunctions(TypeDictionary typedefDictionary, TypeDictionary structDictionary, Map<Type,Type> canonMap, List<FunctionSymbol> cFunctions)protected voidbeginProcAddressTable()voidbeginStructs(TypeDictionary typedefDictionary, TypeDictionary structDictionary, Map<Type,Type> canonMap)protected booleancallThroughProcAddress(FunctionSymbol sym)protected JavaConfigurationcreateConfig()Create the object that will read and store configuration information for this JavaEmitter.protected voidemitProcAddressTableEntryForString(String str)voidendFunctions()protected voidendProcAddressTable()protected voidfixSecurityModifiers(JavaMethodBindingEmitter javaEmitter)If 'native', enforce 'private native' modifiers.protected List<? extends FunctionEmitter>generateMethodBindingEmitters(FunctionSymbol sym)Generate all appropriate Java bindings for the specified C function symbols.protected voidgenerateModifiedEmitters(CMethodBindingEmitter baseCEmitter, List<FunctionEmitter> emitters)protected voidgenerateModifiedEmitters(JavaMethodBindingEmitter baseJavaEmitter, List<FunctionEmitter> emitters)protected StringgetFunctionPointerTypedefName(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.protected ProcAddressConfigurationgetProcAddressConfig()protected booleanhasFunctionPointerTypedef(FunctionSymbol sym)protected booleanneedsModifiedEmitters(FunctionSymbol sym)StringruntimeExceptionType()StringunsupportedExceptionType()-
Methods inherited from class com.jogamp.gluegen.JavaEmitter
addStrings2Buffer, beginDefines, beginEmission, beginStructLayout, cUnit, emitAllFileFooters, emitAllFileHeaders, emitCustomJavaCode, emitCustomJNICode, emitDefine, emitFunctions, emitStruct, endDefines, endEmission, endStructLayout, endStructs, expandMethodBinding, generatePrivateEmitters, generatePublicEmitters, getClassAccessModifiers, getConfig, getImplPackageName, getJavaOutputDir, getJavaPackageName, getJNIMethodNamePrefix, javaImplUnit, javaUnit, jniMangle, layoutStruct, mangleBinding, openCUnit, openJavaUnit, prepCEmitter, readConfigurationFile
-
-
-
-
Field Detail
-
PROCADDRESS_VAR_PREFIX
public static final String PROCADDRESS_VAR_PREFIX
Must be synchronized w/ ProcAddressTable.PROCADDRESS_VAR_PREFIX !!!- See Also:
- Constant Field Values
-
WRAP_PREFIX
protected static final String WRAP_PREFIX
- See Also:
- Constant Field Values
-
tableJavaUnit
protected JavaCodeUnit tableJavaUnit
-
tableClassPackage
protected String tableClassPackage
-
tableClassName
protected String tableClassName
-
-
Method Detail
-
beginFunctions
public void beginFunctions(TypeDictionary typedefDictionary, TypeDictionary structDictionary, Map<Type,Type> canonMap, List<FunctionSymbol> cFunctions) throws Exception
- Specified by:
beginFunctionsin interfaceGlueEmitter- Overrides:
beginFunctionsin classJavaEmitter- Throws:
Exception
-
endFunctions
public void endFunctions() throws Exception- Specified by:
endFunctionsin interfaceGlueEmitter- Overrides:
endFunctionsin classJavaEmitter- Throws:
Exception
-
beginStructs
public void beginStructs(TypeDictionary typedefDictionary, TypeDictionary structDictionary, Map<Type,Type> canonMap) throws Exception
- Specified by:
beginStructsin interfaceGlueEmitter- Overrides:
beginStructsin classJavaEmitter- Throws:
Exception
-
runtimeExceptionType
public String runtimeExceptionType()
-
unsupportedExceptionType
public String unsupportedExceptionType()
-
createConfig
protected JavaConfiguration createConfig()
Description copied from class:JavaEmitterCreate the object that will read and store configuration information for this JavaEmitter.- Overrides:
createConfigin classJavaEmitter
-
generateMethodBindingEmitters
protected List<? extends FunctionEmitter> generateMethodBindingEmitters(FunctionSymbol sym) throws Exception
Description copied from class:JavaEmitterGenerate all appropriate Java bindings for the specified C function symbols.- Overrides:
generateMethodBindingEmittersin classJavaEmitter- Throws:
Exception
-
needsModifiedEmitters
protected boolean needsModifiedEmitters(FunctionSymbol sym)
-
getFunctionPointerTypedefName
protected String getFunctionPointerTypedefName(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. 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.
-
fixSecurityModifiers
protected void fixSecurityModifiers(JavaMethodBindingEmitter javaEmitter)
If 'native', enforce 'private native' modifiers.
-
generateModifiedEmitters
protected void generateModifiedEmitters(JavaMethodBindingEmitter baseJavaEmitter, List<FunctionEmitter> emitters)
-
generateModifiedEmitters
protected void generateModifiedEmitters(CMethodBindingEmitter baseCEmitter, List<FunctionEmitter> emitters)
-
callThroughProcAddress
protected boolean callThroughProcAddress(FunctionSymbol sym)
-
hasFunctionPointerTypedef
protected boolean hasFunctionPointerTypedef(FunctionSymbol sym)
-
emitProcAddressTableEntryForString
protected void emitProcAddressTableEntryForString(String str)
-
getProcAddressConfig
protected ProcAddressConfiguration getProcAddressConfig()
-
-