40package com.jogamp.gluegen.cgram.types;
42import com.jogamp.gluegen.ASTLocusTag;
46 private final boolean unsigned;
47 private boolean typedefUnsigned;
49 public IntType(
final String name,
final SizeThunk size,
final boolean unsigned,
final int cvAttributes) {
50 this(name, size, unsigned, cvAttributes,
null);
54 final boolean unsigned,
final int cvAttributes,
56 super(name, size, cvAttributes, astLocus);
57 this.unsigned = unsigned;
58 this.typedefUnsigned =
false;
73 final boolean unsigned,
final int cvAttributes,
74 final boolean isTypedef,
final boolean typedefUnsigned,
76 super(name, size, cvAttributes, astLocus);
77 this.unsigned = unsigned;
81 this.typedefUnsigned = typedefUnsigned;
83 this.typedefUnsigned =
false;
88 super(o, cvAttributes, astLocus);
89 this.unsigned = o.unsigned;
90 this.typedefUnsigned = o.typedefUnsigned;
95 return new IntType(
this, cvAttributes, astLocus);
102 hash = ((hash << 5) - hash) + (
unsigned ? 1 : 0 );
103 return ((hash << 5) - hash) + ( typedefUnsigned ? 1 : 0 );
109 return unsigned == t.unsigned &&
110 typedefUnsigned == t.typedefUnsigned;
118 hash = ((hash << 5) - hash) + (
unsigned ? 1 : 0 );
119 hash = ((hash << 5) - hash) + ( typedefUnsigned ? 1 : 0 );
128 (
unsigned == t.unsigned &&
129 typedefUnsigned == t.typedefUnsigned
144 public String
getCName(
final boolean includeCVAttrs) {
145 if ( !
unsigned || typedefUnsigned ) {
146 return super.getCName(includeCVAttrs);
148 return "unsigned "+super.getCName(includeCVAttrs);
159 if( super.setTypedefName(name) ) {
160 typedefUnsigned = unsigned;
IntType(final String name, final SizeThunk size, final boolean unsigned, final int cvAttributes)
IntType asInt()
Casts this to an IntType or returns null if not an IntType.
String toString()
Returns a string representation of this type.
boolean equalSemanticsImpl(final Type arg)
boolean setTypedefName(final String name)
Set the typedef name of this type and renders this type a typedef, if given name has a length.
boolean equalsImpl(final Type arg)
String getCName(final boolean includeCVAttrs)
Returns the name of this type, optionally including const/volatile attributes.
IntType(final String name, final SizeThunk size, final boolean unsigned, final int cvAttributes, final boolean isTypedef, final boolean typedefUnsigned, final ASTLocusTag astLocus)
Only for HeaderParser!
IntType(final String name, final SizeThunk size, final boolean unsigned, final int cvAttributes, final ASTLocusTag astLocus)
boolean isUnsigned()
Indicates whether this type is unsigned.
int hashCodeSemanticsImpl()
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 boolean relaxedEqSem
final Type newCVVariant(final int cvAttributes)
Return a variant of this type matching the given const/volatile attributes.