Top Description Fields Constructors Methods
com.jogamp.gluegen.procaddress

public Class ProcAddressEmitter

extends JavaEmitter
Class Inheritance
Imports
java.io.File, .PrintWriter, java.text.MessageFormat, java.util.ArrayList, .HashSet, .List, .Map, .Set, java.util.logging.Level, com.jogamp.gluegen.CMethodBindingEmitter, .CodeGenUtils, .FunctionEmitter, .JavaConfiguration, .JavaEmitter, .JavaMethodBindingEmitter, com.jogamp.gluegen.cgram.types.FunctionSymbol, .Type, .TypeDictionary, com.jogamp.gluegen.runtime.FunctionAddressResolver, .ProcAddressTable

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.

Field Summary

Modifier and TypeField and Description
protected Set<String>
public static final String
PROCADDRESS_VAR_PREFIX

Must be synchronized w/ ProcAddressTable.PROCADDRESS_VAR_PREFIX !!!

protected String
protected String
protected PrintWriter
private TypeDictionary
protected static final String
Inherited from com.jogamp.gluegen.JavaEmitter:
cfgLOG

Constructor Summary

AccessConstructor and Description
public

Method Summary

Modifier and TypeMethod and Description
public void
beginFunctions(final TypeDictionary typedefDictionary, final TypeDictionary structDictionary, final Map<Type, Type> canonMap)

Overrides com.jogamp.gluegen.JavaEmitter.beginFunctions.

Implements com.jogamp.gluegen.GlueEmitter.beginFunctions.

protected void
public void
beginStructs(final TypeDictionary typedefDictionary, final TypeDictionary structDictionary, final Map<Type, Type> canonMap)

Overrides com.jogamp.gluegen.JavaEmitter.beginStructs.

Implements com.jogamp.gluegen.GlueEmitter.beginStructs.

protected boolean
protected JavaConfiguration
createConfig()

Overrides com.jogamp.gluegen.JavaEmitter.createConfig.

Create the object that will read and store configuration information for this JavaEmitter.
protected void
public void
protected void
protected void
fixSecurityModifiers(final JavaMethodBindingEmitter javaEmitter)

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

protected List<? extends FunctionEmitter>
generateMethodBindingEmitters(final FunctionSymbol sym)

Overrides com.jogamp.gluegen.JavaEmitter.generateMethodBindingEmitters.

Generate all appropriate Java bindings for the specified C function symbols.
private List<? extends FunctionEmitter>
protected void
protected void
protected 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.

protected ProcAddressConfiguration
protected boolean
protected boolean
public String
public String
Inherited from com.jogamp.gluegen.JavaEmitter:
addStrings2BufferbeginDefinesbeginEmissionbeginStructLayoutcFileNamecWriteremitAllFileFootersemitAllFileHeadersemitCHeaderemitCInitCodeemitCustomJavaCodeemitDefineemitFunctionsemitJavaInitCodeemitStructendDefinesendEmissionendStructLayoutendStructsexpandMethodBindinggeneratePrivateEmittersgeneratePublicEmittersgetClassAccessModifiersgetConfiggetConfigurationgetImplPackageNamegetJavaOutputDirgetJavaPackageNamegetJNIMethodNamePrefixjavaFileNamejavaImplWriterjavaWriterjniManglelayoutStructmangleBindingopenFileprepCEmitterreadConfigurationFilerequiresStaticInitialization

Field Detail

emittedTableEntriesback to summary
protected Set<String> emittedTableEntries
PROCADDRESS_VAR_PREFIXback to summary
public static final String PROCADDRESS_VAR_PREFIX

Must be synchronized w/ ProcAddressTable.PROCADDRESS_VAR_PREFIX !!!

tableClassNameback to summary
protected String tableClassName
tableClassPackageback to summary
protected String tableClassPackage
tableWriterback to summary
protected PrintWriter tableWriter
typedefDictionaryback to summary
private TypeDictionary typedefDictionary
WRAP_PREFIXback to summary
protected static final String WRAP_PREFIX

Constructor Detail

ProcAddressEmitterback to summary
public ProcAddressEmitter()

Method Detail

beginFunctionsback to summary
public void beginFunctions(final TypeDictionary typedefDictionary, final TypeDictionary structDictionary, final Map<Type, Type> canonMap) throws Exception

Overrides com.jogamp.gluegen.JavaEmitter.beginFunctions.

Implements com.jogamp.gluegen.GlueEmitter.beginFunctions.

Annotations
@Override
beginProcAddressTableback to summary
protected void beginProcAddressTable() throws Exception
beginStructsback to summary
public void beginStructs(final TypeDictionary typedefDictionary, final TypeDictionary structDictionary, final Map<Type, Type> canonMap) throws Exception

Overrides com.jogamp.gluegen.JavaEmitter.beginStructs.

Implements com.jogamp.gluegen.GlueEmitter.beginStructs.

Annotations
@Override
callThroughProcAddressback to summary
protected boolean callThroughProcAddress(final FunctionSymbol sym)
createConfigback to summary
protected JavaConfiguration createConfig()

Overrides com.jogamp.gluegen.JavaEmitter.createConfig.

Doc from com.jogamp.gluegen.JavaEmitter.createConfig.

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

Annotations
@Override
emitProcAddressTableEntryForStringback to summary
protected void emitProcAddressTableEntryForString(final String str)
endFunctionsback to summary
public void endFunctions() throws Exception

Overrides com.jogamp.gluegen.JavaEmitter.endFunctions.

Implements com.jogamp.gluegen.GlueEmitter.endFunctions.

Annotations
@Override
endProcAddressTableback to summary
protected void endProcAddressTable() throws Exception
fixSecurityModifiersback to summary
protected void fixSecurityModifiers(final JavaMethodBindingEmitter javaEmitter)

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

generateMethodBindingEmittersback to summary
protected List<? extends FunctionEmitter> generateMethodBindingEmitters(final FunctionSymbol sym) throws Exception

Overrides com.jogamp.gluegen.JavaEmitter.generateMethodBindingEmitters.

Doc from com.jogamp.gluegen.JavaEmitter.generateMethodBindingEmitters.

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

Annotations
@Override
generateMethodBindingEmittersImplback to summary
private List<? extends FunctionEmitter> generateMethodBindingEmittersImpl(final FunctionSymbol sym) throws Exception
generateModifiedEmittersback to summary
protected void generateModifiedEmitters(final JavaMethodBindingEmitter baseJavaEmitter, final List<FunctionEmitter> emitters)
generateModifiedEmittersback to summary
protected void generateModifiedEmitters(final CMethodBindingEmitter baseCEmitter, final List<FunctionEmitter> emitters)
getFunctionPointerTypedefNameback to summary
protected 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. 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.

getProcAddressConfigback to summary
protected ProcAddressConfiguration getProcAddressConfig()
hasFunctionPointerTypedefback to summary
protected boolean hasFunctionPointerTypedef(final FunctionSymbol sym)
needsModifiedEmittersback to summary
protected boolean needsModifiedEmitters(final FunctionSymbol sym)
runtimeExceptionTypeback to summary
public String runtimeExceptionType()
unsupportedExceptionTypeback to summary
public String unsupportedExceptionType()