Package com.jogamp.gluegen.cgram.types
Class FunctionType
java.lang.Object
com.jogamp.gluegen.cgram.types.Type
com.jogamp.gluegen.cgram.types.FunctionType
- All Implemented Interfaces:
ASTLocusTag.ASTLocusTagProvider,TypeComparator.SemanticEqualityOp,Cloneable
Describes a function type, used to model both function
declarations and (via PointerType) function pointers.
-
Field Summary
Fields inherited from class com.jogamp.gluegen.cgram.types.Type
relaxedEqSem -
Constructor Summary
ConstructorsConstructorDescriptionFunctionType(String name, SizeThunk size, Type returnType, int cvAttributes) FunctionType(String name, SizeThunk size, Type returnType, int cvAttributes, ASTLocusTag astLocus) -
Method Summary
Modifier and TypeMethodDescriptionvoidaddArgument(Type argumentType, String argumentName) Add an argument's name and type.Casts this to a FunctionType or returns null if not a FunctionType.protected booleanequalSemanticsImpl(Type arg) protected booleanequalsImpl(Type arg) getArgumentName(int i) Returns the name of the ith argument.getArgumentType(int i) Returns the type of the ith argument.intReturns the return type of this function.protected intprotected intvoidsetArgumentName(int i, String name) toString()Returns a string representation of this type.voidvisit(TypeVisitor arg) Traverse thisTypeand all of its component types; for example, the return type and argument types of a FunctionType.Methods inherited from class com.jogamp.gluegen.cgram.types.Type
arrayDimension, asArray, asBit, asCompound, asDouble, asEnum, asFloat, asInt, asPointer, asVoid, clearCache, clone, equals, equalSemantics, getASTLocusTag, getBaseElementType, getCName, getCName, getCVAttributes, getCVAttributesString, getDebugString, getName, getName, getSize, getSize, getTargetType, hashCode, hashCodeSemantics, isAnon, isArray, isBaseTypeConst, isBit, isCompound, isConst, isDouble, isEnum, isFloat, isFunction, isFunctionPointer, isInt, isPointer, isPrimitive, isTypedef, isVoid, isVolatile, newCVVariant, pointerDepth, setTypedefName
-
Constructor Details
-
FunctionType
-
FunctionType
public FunctionType(String name, SizeThunk size, Type returnType, int cvAttributes, ASTLocusTag astLocus)
-
-
Method Details
-
hashCodeImpl
protected int hashCodeImpl()- Specified by:
hashCodeImplin classType
-
equalsImpl
- Specified by:
equalsImplin classType
-
hashCodeSemanticsImpl
protected int hashCodeSemanticsImpl()- Specified by:
hashCodeSemanticsImplin classType
-
equalSemanticsImpl
- Specified by:
equalSemanticsImplin classType
-
asFunction
Description copied from class:TypeCasts this to a FunctionType or returns null if not a FunctionType.- Overrides:
asFunctionin classType
-
getReturnType
Returns the return type of this function. -
getNumArguments
public int getNumArguments() -
getArgumentName
Returns the name of the ith argument. May return null if no argument names were available during parsing. -
getArgumentType
Returns the type of the ith argument. -
addArgument
Add an argument's name and type. Use null for unknown argument names. -
setArgumentName
-
toString
Description copied from class:TypeReturns 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. -
toString
-
visit
Description copied from class:TypeTraverse thisTypeand all of its component types; for example, the return type and argument types of a FunctionType.
-