Package com.jogamp.gluegen.cgram.types
Class PointerType
- java.lang.Object
-
- com.jogamp.gluegen.cgram.types.Type
-
- com.jogamp.gluegen.cgram.types.PointerType
-
- All Implemented Interfaces:
ASTLocusTag.ASTLocusTagProvider
,TypeComparator.SemanticEqualityOp
,Cloneable
public class PointerType extends Type implements Cloneable
-
-
Field Summary
-
Fields inherited from class com.jogamp.gluegen.cgram.types.Type
relaxedEqSem
-
-
Constructor Summary
Constructors Constructor Description PointerType(SizeThunk size, Type targetType, int cvAttributes)
PointerType(SizeThunk size, Type targetType, int cvAttributes, ASTLocusTag astLocus)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description PointerType
asPointer()
Casts this to a PointerType or returns null if not a PointerType.protected boolean
equalSemanticsImpl(Type arg)
protected boolean
equalsImpl(Type arg)
Type
getArrayBaseOrPointerTargetType()
Type
getBaseType()
Helper method to returns the bottom-most element type of this type, i.e.String
getCName(boolean includeCVAttrs)
Returns the name of this type, optionally including const/volatile attributes.String
getName(boolean includeCVAttrs)
Returns the name of this type, optionally including const/volatile attributes.FunctionType
getTargetFunction()
Returns the targetFunctionType
if this type isType.isFunctionPointer()
.Type
getTargetType()
Helper method to returns the target type of this type, in case another type is being referenced, i.e.protected int
hashCodeImpl()
protected int
hashCodeSemanticsImpl()
boolean
isAnon()
boolean
isFunctionPointer()
Convenience routine indicating whether this Type is a pointer to a function.int
pointerDepth()
Helper method for determining how many pointer indirections this type represents (i.e., "void **" returns 2).String
toString()
Returns a string representation of this type.String
toString(String functionName, String callingConvention)
For use only when printing function pointers.void
visit(TypeVisitor arg)
Traverse thisType
and 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, asFunction, asInt, asVoid, clearCache, clone, equals, equalSemantics, getASTLocusTag, getCName, getCVAttributes, getCVAttributesString, getDebugString, getName, getSignature, getSize, getSize, hashCode, hashCodeSemantics, hasSize, isArray, isBaseTypeConst, isBit, isCompound, isConst, isDouble, isEnum, isFloat, isFunction, isInt, isPointer, isPrimitive, isTypedef, isVoid, isVolatile, newCVVariant, setTypedefName
-
-
-
-
Constructor Detail
-
PointerType
public PointerType(SizeThunk size, Type targetType, int cvAttributes, ASTLocusTag astLocus)
-
-
Method Detail
-
hashCodeImpl
protected int hashCodeImpl()
- Specified by:
hashCodeImpl
in classType
-
equalsImpl
protected boolean equalsImpl(Type arg)
- Specified by:
equalsImpl
in classType
-
hashCodeSemanticsImpl
protected int hashCodeSemanticsImpl()
- Specified by:
hashCodeSemanticsImpl
in classType
-
equalSemanticsImpl
protected boolean equalSemanticsImpl(Type arg)
- Specified by:
equalSemanticsImpl
in classType
-
getName
public String getName(boolean includeCVAttrs)
Description copied from class:Type
Returns the name of this type, optionally including const/volatile attributes. The returned string is suitable for use as a type specifier for Java.
-
getCName
public String getCName(boolean includeCVAttrs)
Description copied from class:Type
Returns the name of this type, optionally including const/volatile attributes. The returned string is suitable for use as a type specifier for native C.
-
asPointer
public final PointerType asPointer()
Description copied from class:Type
Casts this to a PointerType or returns null if not a PointerType.
-
getTargetType
public final Type getTargetType()
Description copied from class:Type
Helper method to returns the target type of this type, in case another type is being referenced, i.e. returns `type
` if this-type is `type
*` or `type
[]` and returns `type
*` if this-type is `type
**` or `type
[][]`.If this is an array or pointer method returns the next target element type, otherwise `this`.
In this is a
Type.isFunctionPointer()
type, `this` functionPointerType
is returned.- Overrides:
getTargetType
in classType
- See Also:
Type.getBaseType()
,Type.getTargetFunction()
-
getBaseType
public final Type getBaseType()
Description copied from class:Type
Helper method to returns the bottom-most element type of this type, i.e. returns `type
` if this-type is `type
*`, `type
**`, `type
[]` or `type
[][]`.If this is a multidimensional array or pointer method returns the bottom-most element type, otherwise this.
In case a
Type.isFunctionPointer()
type is reached, traversing ends and the functionPointerType
is returned.- Overrides:
getBaseType
in classType
- See Also:
Type.getTargetType()
,Type.getTargetFunction()
-
getArrayBaseOrPointerTargetType
public Type getArrayBaseOrPointerTargetType()
Description copied from class:Type
- Overrides:
getArrayBaseOrPointerTargetType
in classType
-
getTargetFunction
public FunctionType getTargetFunction()
Description copied from class:Type
Returns the targetFunctionType
if this type isType.isFunctionPointer()
.- Overrides:
getTargetFunction
in classType
-
isFunctionPointer
public final boolean isFunctionPointer()
Description copied from class:Type
Convenience routine indicating whether this Type is a pointer to a function.- Overrides:
isFunctionPointer
in classType
-
pointerDepth
public final int pointerDepth()
Description copied from class:Type
Helper method for determining how many pointer indirections this type represents (i.e., "void **" returns 2). Returns 0 if this type is not a pointer type.- Overrides:
pointerDepth
in classType
-
toString
public String toString()
Description copied from class:Type
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.
-
toString
public String toString(String functionName, String callingConvention)
For use only when printing function pointers. Calling convention string (i.e., "__stdcall") is optional and is generally only needed on Windows.
-
visit
public void visit(TypeVisitor arg)
Description copied from class:Type
Traverse thisType
and all of its component types; for example, the return type and argument types of a FunctionType.
-
-