Package com.jogamp.gluegen.cgram.types
Class ArrayType
java.lang.Object
com.jogamp.gluegen.cgram.types.Type
com.jogamp.gluegen.cgram.types.MemoryLayoutType
com.jogamp.gluegen.cgram.types.ArrayType
- All Implemented Interfaces:
ASTLocusTag.ASTLocusTagProvider,TypeComparator.SemanticEqualityOp,Cloneable
Represents an array type. This differs from a pointer type in C
syntax by the use of "[]" rather than "*". The length may or may
not be known; if the length is unknown then a negative number
should be passed in to the constructor.
-
Field Summary
Fields inherited from class com.jogamp.gluegen.cgram.types.Type
relaxedEqSem -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionfinal intHelper method for determining how many array dimentions this type represents (i.e., "char[][]" returns 2).final ArrayTypeasArray()Casts this to an ArrayType or returns null if not an ArrayType.protected booleanequalSemanticsImpl(Type arg) protected booleanequalsImpl(Type arg) final TypeHelper method to returns the bottom-most element type of this type.intgetName(boolean includeCVAttrs) Returns the name of this type, optionally including const/volatile attributes.protected intprotected intbooleanbooleanisAnon()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.MemoryLayoutType
isLayouted, setLayoutedMethods inherited from class com.jogamp.gluegen.cgram.types.Type
asBit, asCompound, asDouble, asEnum, asFloat, asFunction, asInt, asPointer, asVoid, clearCache, clone, equals, equalSemantics, getASTLocusTag, getCName, getCName, getCVAttributes, getCVAttributesString, getDebugString, getName, getSize, getSize, getTargetType, hashCode, hashCodeSemantics, isArray, isBaseTypeConst, isBit, isCompound, isConst, isDouble, isEnum, isFloat, isFunction, isFunctionPointer, isInt, isPointer, isPrimitive, isTypedef, isVoid, isVolatile, newCVVariant, pointerDepth, setTypedefName
-
Constructor Details
-
ArrayType
-
ArrayType
public ArrayType(Type elementType, SizeThunk sizeInBytes, int length, 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
-
isAnon
public boolean isAnon() -
getName
Description copied from class:TypeReturns the name of this type, optionally including const/volatile attributes. The returned string is suitable for use as a type specifier for Java. -
asArray
Description copied from class:TypeCasts this to an ArrayType or returns null if not an ArrayType. -
getElementType
-
getLength
public int getLength() -
hasLength
public boolean hasLength() -
getBaseElementType
Description copied from class:TypeHelper method to returns the bottom-most element type of this type.If this is a multidimensional array or pointer method returns the bottom-most element type, otherwise this.
- Overrides:
getBaseElementTypein classType
-
arrayDimension
public final int arrayDimension()Description copied from class:TypeHelper method for determining how many array dimentions this type represents (i.e., "char[][]" returns 2). Returns 0 if this type is not an array type.- Overrides:
arrayDimensionin classType
-
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.
-