Package com.jogamp.gluegen
Interface GlueEmitter
-
- All Known Implementing Classes:
CStructAnnotationProcessor.AnnotationProcessorJavaStructEmitter
,DebugEmitter
,JavaEmitter
,ProcAddressEmitter
public interface GlueEmitter
Specifies the interface by which GlueGen requests glue code to be generated. Can be replaced to generate glue code for other languages and foreign function interfaces.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
beginDefines()
void
beginEmission(GlueEmitterControls controls)
Begin the emission of glue code.void
beginFunctions(TypeDictionary typedefDictionary, TypeDictionary structDictionary, Map<Type,Type> canonMap, List<FunctionSymbol> cFunctions)
void
beginStructLayout()
Begins the process of computing field offsets and type sizes for the structs to be emitted.void
beginStructs(TypeDictionary typedefDictionary, TypeDictionary structDictionary, Map<Type,Type> canonMap)
void
emitDefine(ConstantDefinition def, String optionalComment)
Iterator<FunctionSymbol>
emitFunctions(List<FunctionSymbol> cFunctions)
Emit glue code for the list of FunctionSymbols.void
emitStruct(CompoundType t, Type typedefType)
Emit glue code for the given CompoundType.void
endDefines()
void
endEmission()
Finish the emission of glue code.void
endFunctions()
void
endStructLayout()
Finishes the struct layout process.void
endStructs()
JavaConfiguration
getConfig()
void
layoutStruct(CompoundType t)
Lays out one struct which will be emitted later.void
readConfigurationFile(String filename)
-
-
-
Method Detail
-
readConfigurationFile
void readConfigurationFile(String filename) throws Exception
- Throws:
Exception
-
getConfig
JavaConfiguration getConfig()
-
beginEmission
void beginEmission(GlueEmitterControls controls) throws Exception
Begin the emission of glue code. This might include opening files, emitting class headers, etc.- Throws:
Exception
-
endEmission
void endEmission() throws Exception
Finish the emission of glue code. This might include closing files, closing open class definitions, etc.- Throws:
Exception
-
emitDefine
void emitDefine(ConstantDefinition def, String optionalComment) throws Exception
- Parameters:
optionalComment
- If optionalComment is non-null, the emitter can emit that string as a comment providing extra information about the define.- Throws:
Exception
-
beginFunctions
void beginFunctions(TypeDictionary typedefDictionary, TypeDictionary structDictionary, Map<Type,Type> canonMap, List<FunctionSymbol> cFunctions) throws Exception
- Throws:
Exception
-
emitFunctions
Iterator<FunctionSymbol> emitFunctions(List<FunctionSymbol> cFunctions) throws Exception
Emit glue code for the list of FunctionSymbols.- Throws:
Exception
-
beginStructLayout
void beginStructLayout() throws Exception
Begins the process of computing field offsets and type sizes for the structs to be emitted.- Throws:
Exception
-
layoutStruct
void layoutStruct(CompoundType t) throws Exception
Lays out one struct which will be emitted later.- Throws:
Exception
-
endStructLayout
void endStructLayout() throws Exception
Finishes the struct layout process.- Throws:
Exception
-
beginStructs
void beginStructs(TypeDictionary typedefDictionary, TypeDictionary structDictionary, Map<Type,Type> canonMap) throws Exception
- Throws:
Exception
-
emitStruct
void emitStruct(CompoundType t, Type typedefType) throws Exception
Emit glue code for the given CompoundType. typedefType is provided when the CompoundType (e.g. "struct foo_t") has not been typedefed to anything but the type of "pointer to struct foo_t" has (e.g. "typedef struct foo_t {} *Foo"); in this case typedefType would be set to pointer type Foo.- Throws:
Exception
-
-