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

public Class ArrayType

extends MemoryLayoutType
implements Cloneable
Class Inheritance
All Implemented Interfaces
java.lang.Cloneable
Imports
com.jogamp.gluegen.ASTLocusTag

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

Modifier and TypeField and Description
private final Type
private final int

Constructor Summary

AccessConstructor and Description
public
ArrayType(final Type elementType, final SizeThunk sizeInBytes, final int length, final int cvAttributes)

public
ArrayType(final Type elementType, final SizeThunk sizeInBytes, final int length, final int cvAttributes, final ASTLocusTag astLocus)

private
ArrayType(final ArrayType o, final int cvAttributes, final ASTLocusTag astLocus)

Method Summary

Modifier and TypeMethod and Description
public final int
arrayDimension()

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

Helper method for determining how many array dimentions this type represents (i.e., "char[][]" returns 2).
public final ArrayType
asArray()

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

Casts this to an ArrayType or returns null if not an ArrayType.
protected boolean
protected boolean
public final Type
getBaseElementType()

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

Helper method to returns the bottom-most element type of this type.
public Type
public int
public String
getName(final boolean includeCVAttrs)

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

Returns the name of this type, optionally including const/volatile attributes.
protected int
protected int
public boolean
public boolean
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)!

pack-priv void
recomputeSize()

Recompute the size of this array if necessary.

public String
toString()

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

Returns a string representation of this type.
public String
toString(final String variableName)

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.MemoryLayoutType:
isLayoutedsetLayouted

Field Detail

elementTypeback to summary
private final Type elementType
lengthback to summary
private final int length

Constructor Detail

ArrayTypeback to summary
public ArrayType(final Type elementType, final SizeThunk sizeInBytes, final int length, final int cvAttributes)
ArrayTypeback to summary
public ArrayType(final Type elementType, final SizeThunk sizeInBytes, final int length, final int cvAttributes, final ASTLocusTag astLocus)
ArrayTypeback to summary
private ArrayType(final ArrayType o, final int cvAttributes, final ASTLocusTag astLocus)

Method Detail

arrayDimensionback to summary
public final int arrayDimension()

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

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

Helper 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.

Annotations
@Override
asArrayback to summary
public final ArrayType asArray()

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

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

Casts this to an ArrayType or returns null if not an ArrayType.

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
getBaseElementTypeback to summary
public final Type getBaseElementType()

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

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

Helper 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.

Annotations
@Override
getElementTypeback to summary
public Type getElementType()
getLengthback to summary
public int getLength()
getNameback to summary
public String getName(final boolean includeCVAttrs)

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

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

Returns the name of this type, optionally including const/volatile attributes. The returned string is suitable for use as a type specifier for Java.

Annotations
@Override
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
hasLengthback to summary
public boolean hasLength()
isAnonback to summary
public boolean isAnon()

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

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
recomputeSizeback to summary
pack-priv void recomputeSize()

Recompute the size of this array if necessary. This needs to be done when the base element type is a compound type after layouting.

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 variableName)
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