41package com.jogamp.gluegen.cgram.types;
43import com.jogamp.gluegen.ASTLocusTag;
48 private final IntType underlyingType;
49 private final int sizeInBits;
50 private final int offset;
52 public BitType(
final IntType underlyingType,
final int sizeInBits,
final int lsbOffset,
53 final int cvAttributes,
final ASTLocusTag astLocus) {
55 this.underlyingType = underlyingType;
56 this.sizeInBits = sizeInBits;
57 this.offset = lsbOffset;
61 super(o, cvAttributes, astLocus);
62 underlyingType = o.underlyingType;
63 sizeInBits = o.sizeInBits;
69 return new BitType(
this, cvAttributes, astLocus);
75 int hash = super.hashCodeImpl();
76 hash = ((hash << 5) - hash) + underlyingType.
hashCode();
77 hash = ((hash << 5) - hash) + sizeInBits;
78 return ((hash << 5) - hash) + offset;
85 underlyingType.
equals(t.underlyingType) &&
86 sizeInBits == t.sizeInBits &&
93 int hash = super.hashCodeSemanticsImpl();
95 hash = ((hash << 5) - hash) + sizeInBits;
96 return ((hash << 5) - hash) + offset;
104 sizeInBits == t.sizeInBits &&
125 underlyingType.
visit(arg);
Represents a bitfield in a struct.
int hashCodeSemanticsImpl()
boolean equalSemanticsImpl(final Type arg)
BitType asBit()
Casts this to a BitType or returns null if not a BitType.
boolean equalsImpl(final Type arg)
BitType(final IntType underlyingType, final int sizeInBits, final int lsbOffset, final int cvAttributes, final ASTLocusTag astLocus)
int getSizeInBits()
Size in bits of this type.
int getOffset()
Offset from the least-significant bit (LSB) of the LSB of this type.
void visit(final TypeVisitor arg)
Traverse this Type and all of its component types; for example, the return type and argument types of...
boolean isUnsigned()
Indicates whether this type is unsigned.
final int hashCodeSemantics()
Semantic hashcode for Types exclusive its given name.
abstract boolean equalSemanticsImpl(final Type t)
final int hashCode()
Hashcode for Types.
abstract boolean equalsImpl(final Type t)
final boolean equalSemantics(final SemanticEqualityOp arg)
Semantic equality test for Types exclusive its given name.
final String getName()
Returns the name of this type.
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.
final SizeThunk getSize()
SizeThunk which computes size of this type in bytes.
final Type newCVVariant(final int cvAttributes)
Return a variant of this type matching the given const/volatile attributes.
A visitor for Type's visitor model.