Top Description Fields Constructors Methods
com.jogamp.gluegen.cgram.types

public Class FunctionType

extends Type
implements Cloneable
Class Inheritance
All Implemented Interfaces
java.lang.Cloneable
Imports
java.util.*, com.jogamp.gluegen.ASTLocusTag

Describes a function type, used to model both function declarations and (via PointerType) function pointers.

Field Summary

Modifier and TypeField and Description
private ArrayList<String>
private ArrayList<Type>
private final Type
Inherited from com.jogamp.gluegen.cgram.types.Type:
astLocusrelaxedEqSem

Constructor Summary

AccessConstructor and Description
public
FunctionType(final String name, final SizeThunk size, final Type returnType, final int cvAttributes)

public
FunctionType(final String name, final SizeThunk size, final Type returnType, final int cvAttributes, final ASTLocusTag astLocus)

private
FunctionType(final FunctionType o, final ASTLocusTag astLocus)

Method Summary

Modifier and TypeMethod and Description
public void
addArgument(final Type argumentType, final String argumentName)

Add an argument's name and type.

public FunctionType
asFunction()

Overrides com.jogamp.gluegen.cgram.types.Type.asFunction.

Casts this to a FunctionType or returns null if not a FunctionType.
protected boolean
protected boolean
public String
getArgumentName(final int i)

Returns the name of the ith argument.

public Type
getArgumentType(final int i)

Returns the type of the ith argument.

public int
public Type
getReturnType()

Returns the return type of this function.

protected int
protected int
pack-priv Type
newVariantImpl(final boolean
true if new variant is intended to have new cvAttributes
newCVVariant
,
final int
the cvAttributes to be used
cvAttributes
,
final ASTLocusTag
the ASTLocusTag to be used
astLocus
)

Implements abstract com.jogamp.gluegen.cgram.types.Type.newVariantImpl.

Create a new variant of this type matching the given parameter

Implementation must use Type's copy-ctor: Type(Type, int, ASTLocusTag)!

public void
setArgumentName(final int i, final String name)

public String
toString()

Overrides com.jogamp.gluegen.cgram.types.Type.toString.

Returns a string representation of this type.
public String
toString(final String functionName, final boolean emitNativeTag)

pack-priv String
toString(final String functionName, final String callingConvention, final boolean emitNativeTag, final boolean isPointer)

public void
visit(final TypeVisitor arg)

Overrides com.jogamp.gluegen.cgram.types.Type.visit.

Traverse this Type and all of its component types; for example, the return type and argument types of a FunctionType.
Inherited from com.jogamp.gluegen.cgram.types.Type:
arrayDimensionasArrayasBitasCompoundasDoubleasEnumasFloatasIntasPointerasVoidclearCachecloneequalsequalSemanticsgetASTLocusTaggetBaseElementTypegetCNamegetCNamegetCVAttributesgetCVAttributesStringgetDebugStringgetNamegetNamegetSizegetSizegetTargetTypegetTypedefCVAttributeshashCodehashCodeSemanticsisAnonisArrayisBaseTypeConstisBitisCompoundisConstisDoubleisEnumisFloatisFunctionisFunctionPointerisIntisPointerisPrimitiveisTypedefisVoidisVolatilenewCVVariantpointerDepthsetSizesetTypedefsetTypedefName

Field Detail

argumentNamesback to summary
private ArrayList<String> argumentNames
argumentTypesback to summary
private ArrayList<Type> argumentTypes
returnTypeback to summary
private final Type returnType

Constructor Detail

FunctionTypeback to summary
public FunctionType(final String name, final SizeThunk size, final Type returnType, final int cvAttributes)
FunctionTypeback to summary
public FunctionType(final String name, final SizeThunk size, final Type returnType, final int cvAttributes, final ASTLocusTag astLocus)
FunctionTypeback to summary
private FunctionType(final FunctionType o, final ASTLocusTag astLocus)

Method Detail

addArgumentback to summary
public void addArgument(final Type argumentType, final String argumentName)

Add an argument's name and type. Use null for unknown argument names.

asFunctionback to summary
public FunctionType asFunction()

Overrides com.jogamp.gluegen.cgram.types.Type.asFunction.

Doc from com.jogamp.gluegen.cgram.types.Type.asFunction.

Casts this to a FunctionType or returns null if not a FunctionType.

Annotations
@Override
equalSemanticsImplback to summary
protected boolean equalSemanticsImpl(final Type arg)

Implements abstract com.jogamp.gluegen.cgram.types.Type.equalSemanticsImpl.

Annotations
@Override
equalsImplback to summary
protected boolean equalsImpl(final Type arg)

Implements abstract com.jogamp.gluegen.cgram.types.Type.equalsImpl.

Annotations
@Override
getArgumentNameback to summary
public String getArgumentName(final int i)

Returns the name of the ith argument. May return null if no argument names were available during parsing.

getArgumentTypeback to summary
public Type getArgumentType(final int i)

Returns the type of the ith argument.

getNumArgumentsback to summary
public int getNumArguments()
getReturnTypeback to summary
public Type getReturnType()

Returns the return type of this function.

hashCodeImplback to summary
protected int hashCodeImpl()

Implements abstract com.jogamp.gluegen.cgram.types.Type.hashCodeImpl.

Annotations
@Override
hashCodeSemanticsImplback to summary
protected int hashCodeSemanticsImpl()

Implements abstract com.jogamp.gluegen.cgram.types.Type.hashCodeSemanticsImpl.

Annotations
@Override
newVariantImplback to summary
pack-priv Type newVariantImpl(final boolean newCVVariant, final int cvAttributes, final ASTLocusTag astLocus)

Implements abstract com.jogamp.gluegen.cgram.types.Type.newVariantImpl.

Doc from com.jogamp.gluegen.cgram.types.Type.newVariantImpl.

Create a new variant of this type matching the given parameter

Implementation must use Type's copy-ctor: Type(Type, int, ASTLocusTag)!

Parameters
newCVVariant:boolean

true if new variant is intended to have new cvAttributes

cvAttributes:int

the cvAttributes to be used

astLocus:ASTLocusTag

the ASTLocusTag to be used

Annotations
@Override
setArgumentNameback to summary
public void setArgumentName(final int i, final String name)
toStringback to summary
public String toString()

Overrides com.jogamp.gluegen.cgram.types.Type.toString.

Doc from com.jogamp.gluegen.cgram.types.Type.toString.

Returns a string representation of this type. The returned string is suitable for use as a type specifier for native C. It does contain an expanded description of structs/unions, hence may not be suitable for type declarations.

Returns:String

Doc from java.lang.Object.toString.

a string representation of the object

Annotations
@Override
toStringback to summary
public String toString(final String functionName, final boolean emitNativeTag)
toStringback to summary
pack-priv String toString(final String functionName, final String callingConvention, final boolean emitNativeTag, final boolean isPointer)
visitback to summary
public void visit(final TypeVisitor arg)

Overrides com.jogamp.gluegen.cgram.types.Type.visit.

Doc from com.jogamp.gluegen.cgram.types.Type.visit.

Traverse this Type and all of its component types; for example, the return type and argument types of a FunctionType.

Annotations
@Override