public abstract class CompoundType extends MemoryLayoutType implements Cloneable, AliasedSymbol
AliasedSymbol.AliasedSymbolImpl, AliasedSymbol.NoneAliasedSymbolrelaxedEqSem| 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, setLayoutedarrayDimension, 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, setTypedefNameclone, finalize, getClass, notify, notifyAll, wait, wait, waitgetNamepublic void rename(String newName)
AliasedSymbolnewName 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 AliasedSymbolnewName - the new current-name, maybe nullpublic void addAliasedName(String origName)
AliasedSymbolorigName to the list of aliases
if not equal current-name.
Operation will be ignored if newName is null.
addAliasedName in interface AliasedSymbolorigName - the new alias to be added, maybe nullpublic boolean hasAliases()
AliasedSymboltrue if this symbol has aliases, i.e. either being renamed
or aliases-added.
Otherwise false is being returned.
hasAliases in interface AliasedSymbolpublic 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 AliasedSymbolpublic String getAliasedString()
AliasedSymbolgetAliasedString in interface AliasedSymbolpublic String getOrigName()
AliasedSymbolgetOrigName in interface AliasedSymbolpublic 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 Typeprotected boolean equalsImpl(Type arg)
equalsImpl in class Typeprotected int hashCodeSemanticsImpl()
hashCodeSemanticsImpl in class Typeprotected boolean equalSemanticsImpl(Type arg)
equalSemanticsImpl in class Typepublic String getStructName()
public CompoundType asCompound()
TypeasCompound in class Typepublic String getCName(boolean includeCVAttrs)
Typepublic 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()
Typepublic void visit(TypeVisitor arg)
TypeType and all of its component types; for
example, the return type and argument types of a FunctionType.public String getStructString()