40package com.jogamp.gluegen.cgram.types;
42import com.jogamp.gluegen.ASTLocusTag;
46 private final Type targetType;
49 this(size, targetType, cvAttributes,
null);
54 super(targetType.
getName() +
" *", size, cvAttributes, astLocus);
55 this.targetType = targetType;
59 super(o, cvAttributes, astLocus);
60 targetType = o.targetType;
65 return new PointerType(
this, cvAttributes, astLocus);
76 return targetType.
equals(t.targetType);
93 return super.isAnon();
95 return targetType.
isAnon();
100 public String
getName(
final boolean includeCVAttrs) {
102 return super.getName(includeCVAttrs);
103 }
else if (!includeCVAttrs) {
104 return targetType.
getName(includeCVAttrs) +
" *";
111 public String
getCName(
final boolean includeCVAttrs) {
113 return super.getCName(includeCVAttrs);
114 }
else if (!includeCVAttrs) {
115 return targetType.
getCName(includeCVAttrs) +
" *";
170 return super.getCName(
true);
172 return toStringInt();
175 private String toStringInt() {
180 return ((
FunctionType) targetType).toString(
null ,
null ,
false,
true);
187 public String
toString(
final String functionName,
final String callingConvention) {
189 throw new RuntimeException(
"<Internal error or misuse> This method is only for use when printing function pointers");
191 return ((
FunctionType) targetType).toString(functionName, callingConvention,
false,
true);
197 targetType.
visit(arg);
Describes a function type, used to model both function declarations and (via PointerType) function po...
void visit(final TypeVisitor arg)
Traverse this Type and all of its component types; for example, the return type and argument types of...
final Type getTargetType()
Helper method to returns the target type of this type, in case another type is being referenced,...
FunctionType getTargetFunction()
Returns the target FunctionType if this type is isFunctionPointer().
int hashCodeSemanticsImpl()
String toString()
Returns a string representation of this type.
String getCName(final boolean includeCVAttrs)
Returns the name of this type, optionally including const/volatile attributes.
final Type getBaseType()
Helper method to returns the bottom-most element type of this type, i.e.
final PointerType asPointer()
Casts this to a PointerType or returns null if not a PointerType.
Type getArrayBaseOrPointerTargetType()
Return getBaseType() if isArray() or returns getTargetType() otherwise.
PointerType(final SizeThunk size, final Type targetType, final int cvAttributes)
String toString(final String functionName, final String callingConvention)
For use only when printing function pointers.
boolean equalSemanticsImpl(final Type arg)
String getName(final boolean includeCVAttrs)
Returns the name of this type, optionally including const/volatile attributes.
final int pointerDepth()
Helper method for determining how many pointer indirections this type represents (i....
PointerType(final SizeThunk size, final Type targetType, final int cvAttributes, final ASTLocusTag astLocus)
boolean equalsImpl(final Type arg)
final boolean isFunctionPointer()
Convenience routine indicating whether this Type is a pointer to a function.
Provides a level of indirection between the definition of a type's size and the absolute value of thi...
final String getCName()
Returns the name of this type.
final String getCVAttributesString()
Returns a string indicating the const/volatile attributes of this type.
final int hashCodeSemantics()
Semantic hashcode for Types exclusive its given name.
final int hashCode()
Hashcode for Types.
Type getBaseType()
Helper method to returns the bottom-most element type of this type, i.e.
final boolean equalSemantics(final SemanticEqualityOp arg)
Semantic equality test for Types exclusive its given name.
final String getName()
Returns the name of this type.
int pointerDepth()
Helper method for determining how many pointer indirections this type represents (i....
final boolean isFunction()
Indicates whether this is a FunctionType.
void visit(final TypeVisitor visitor)
Traverse this Type and all of its component types; for example, the return type and argument types of...
final boolean equals(final Object arg)
Equality test for Types inclusive its given name.
FunctionType asFunction()
Casts this to a FunctionType or returns null if not a FunctionType.
final Type newCVVariant(final int cvAttributes)
Return a variant of this type matching the given const/volatile attributes.
final boolean isTypedef()
Indicates whether this type is a typedef type, i.e.
A visitor for Type's visitor model.