public abstract class CompoundType extends MemoryLayoutType implements Cloneable, AliasedSymbol
AliasedSymbol.AliasedSymbolImpl, AliasedSymbol.NoneAliasedSymbol
relaxedEqSem
Modifier and Type | Method and Description |
---|---|
void |
addAliasedName(String origName)
|
void |
addField(Field f)
Adds a field to this type.
|
CompoundType |
asCompound()
Casts this to a CompoundType or returns null if not a CompoundType.
|
static CompoundType |
create(String structName,
SizeThunk size,
CompoundTypeKind kind,
int cvAttributes,
ASTLocusTag astLocus) |
protected boolean |
equalSemanticsImpl(Type arg) |
protected boolean |
equalsImpl(Type arg) |
Set<String> |
getAliasedNames()
Return all aliases for this symbol, i.e.
|
String |
getAliasedString()
|
String |
getCName(boolean includeCVAttrs)
Returns the name of this type, optionally including
const/volatile attributes.
|
Field |
getField(int i)
Returns the ith field of this type.
|
int |
getNumFields()
Returns the number of fields in this type.
|
String |
getOrigName()
Return the original-name as set at creation.
|
String |
getStructName()
Returns the struct name of this CompoundType, i.e.
|
String |
getStructString() |
boolean |
hasAliases()
Returns
true if this symbol has aliases, i.e. |
protected int |
hashCodeImpl() |
protected int |
hashCodeSemanticsImpl() |
abstract boolean |
isStruct()
Indicates whether this type was declared as a struct.
|
abstract boolean |
isUnion()
Indicates whether this type was declared as a union.
|
void |
rename(String newName)
Rename this symbol with the given
newName if not equal current-name . |
void |
setBodyParsed()
Indicates to this CompoundType that its body has been parsed and
that no more
addField(com.jogamp.gluegen.cgram.types.Field) operations will be made. |
String |
toString()
Returns a string representation of this type.
|
void |
visit(TypeVisitor arg)
Traverse this
Type and all of its component types; for
example, the return type and argument types of a FunctionType. |
isLayouted, setLayouted
arrayDimension, asArray, asBit, asDouble, asEnum, asFloat, asFunction, asInt, asPointer, asVoid, clearCache, clone, equals, equalSemantics, getASTLocusTag, getBaseElementType, getCName, getCVAttributes, getCVAttributesString, getDebugString, getName, getName, getSize, getSize, getTargetType, hashCode, hashCodeSemantics, isAnon, isArray, isBaseTypeConst, isBit, isCompound, isConst, isDouble, isEnum, isFloat, isFunction, isFunctionPointer, isInt, isPointer, isPrimitive, isTypedef, isVoid, isVolatile, newCVVariant, pointerDepth, setTypedefName
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
getName
public void rename(String newName)
AliasedSymbol
newName
if not equal current-name
.
Before renaming the current-name
will be added
to the list of aliases
.
while the given newName
will be removed.
Operation will be ignored if newName
is null
.
rename
in interface AliasedSymbol
newName
- the new current-name
, maybe null
public void addAliasedName(String origName)
AliasedSymbol
origName
to the list of aliases
if not equal current-name
.
Operation will be ignored if newName
is null
.
addAliasedName
in interface AliasedSymbol
origName
- the new alias to be added, maybe null
public boolean hasAliases()
AliasedSymbol
true
if this symbol has aliases, i.e. either being renamed
or aliases-added
.
Otherwise false
is being returned.
hasAliases
in interface AliasedSymbol
public Set<String> getAliasedNames()
AliasedSymbol
Inclusive original-name
, if renamed
,
Exclusive current-name
.
May return null
or a zero sized Set
for no aliases.
getAliasedNames
in interface AliasedSymbol
public String getAliasedString()
AliasedSymbol
getAliasedString
in interface AliasedSymbol
public String getOrigName()
AliasedSymbol
getOrigName
in interface AliasedSymbol
public static CompoundType create(String structName, SizeThunk size, CompoundTypeKind kind, int cvAttributes, ASTLocusTag astLocus)
structName
- struct name of this CompoundType, i.e. the "foo" in the
construct struct foo { int a, ... };
or struct foo;
even for anonymous structs.size
- kind
- cvAttributes
- protected int hashCodeImpl()
hashCodeImpl
in class Type
protected boolean equalsImpl(Type arg)
equalsImpl
in class Type
protected int hashCodeSemanticsImpl()
hashCodeSemanticsImpl
in class Type
protected boolean equalSemanticsImpl(Type arg)
equalSemanticsImpl
in class Type
public String getStructName()
public CompoundType asCompound()
Type
asCompound
in class Type
public String getCName(boolean includeCVAttrs)
Type
public int getNumFields()
public Field getField(int i)
public void addField(Field f)
public void setBodyParsed() throws IllegalStateException
addField(com.jogamp.gluegen.cgram.types.Field)
operations will be made.IllegalStateException
- If called twice.public abstract boolean isStruct()
public abstract boolean isUnion()
public String toString()
Type
public void visit(TypeVisitor arg)
Type
Type
and all of its component types; for
example, the return type and argument types of a FunctionType.public String getStructString()