aboutsummaryrefslogtreecommitdiffstats
path: root/src/java/com/jogamp/gluegen/FunctionEmitter.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/java/com/jogamp/gluegen/FunctionEmitter.java')
-rw-r--r--src/java/com/jogamp/gluegen/FunctionEmitter.java40
1 files changed, 15 insertions, 25 deletions
diff --git a/src/java/com/jogamp/gluegen/FunctionEmitter.java b/src/java/com/jogamp/gluegen/FunctionEmitter.java
index 8e9d306..bfbb73b 100644
--- a/src/java/com/jogamp/gluegen/FunctionEmitter.java
+++ b/src/java/com/jogamp/gluegen/FunctionEmitter.java
@@ -42,57 +42,43 @@ package com.jogamp.gluegen;
import java.util.*;
import java.io.*;
+import com.jogamp.gluegen.cgram.types.FunctionSymbol;
import com.jogamp.gluegen.cgram.types.Type;
public abstract class FunctionEmitter {
public static final EmissionModifier STATIC = new EmissionModifier("static");
- private final boolean isInterfaceVal;
+ private final boolean isInterface;
private final ArrayList<EmissionModifier> modifiers;
private CommentEmitter commentEmitter = null;
private final PrintWriter defaultOutput;
+ // Only present to provide more clear comments
+ protected final JavaConfiguration cfg;
/**
* Constructs the FunctionEmitter with a CommentEmitter that emits nothing.
*/
- public FunctionEmitter(final PrintWriter defaultOutput, final boolean isInterface) {
+ public FunctionEmitter(final PrintWriter defaultOutput, final boolean isInterface, final JavaConfiguration configuration) {
assert(defaultOutput != null);
+ this.isInterface = isInterface;
this.modifiers = new ArrayList<EmissionModifier>();
this.defaultOutput = defaultOutput;
- this.isInterfaceVal = isInterface;
+ this.cfg = configuration;
}
/**
* Makes this FunctionEmitter a copy of the passed one.
*/
public FunctionEmitter(final FunctionEmitter arg) {
+ isInterface = arg.isInterface;
modifiers = new ArrayList<EmissionModifier>(arg.modifiers);
commentEmitter = arg.commentEmitter;
defaultOutput = arg.defaultOutput;
- isInterfaceVal = arg.isInterfaceVal;
+ cfg = arg.cfg;
}
- public boolean isInterface() { return isInterfaceVal; }
-
- /**
- * Checks the base type of pointer-to-pointer, pointer, array or plain for const-ness.
- * <p>
- * Note: Implementation walks down to the base type and returns it's const-ness.
- * Intermediate 'const' qualifier are not considered, e.g. const pointer.
- * </p>
- */
- protected final boolean isBaseTypeConst(final Type type) {
- if ( 2 == type.pointerDepth() ) {
- return type.asPointer().getTargetType().asPointer().getTargetType().isConst();
- } else if ( 1 == type.pointerDepth() ) {
- return type.asPointer().getTargetType().isConst();
- } else if( type.isArray() ) {
- return type.asArray().getBaseElementType().isConst();
- } else {
- return type.isConst();
- }
- }
+ public boolean isInterface() { return isInterface; }
public PrintWriter getDefaultOutput() { return defaultOutput; }
@@ -111,7 +97,11 @@ public abstract class FunctionEmitter {
public Iterator<EmissionModifier> getModifiers() { return modifiers.iterator(); }
- public abstract String getName();
+ public abstract String getInterfaceName();
+ public abstract String getImplName();
+ public abstract String getNativeName();
+
+ public abstract FunctionSymbol getCSymbol();
/**
* Emit the function to the specified output (instead of the default