Top Description Fields Constructors Methods
com.jogamp.gluegen.cgram.types

public abstract Class CompoundType

extends MemoryLayoutType
implements Cloneable, AliasedSymbol
Class Inheritance
All Implemented Interfaces
com.jogamp.gluegen.cgram.types.AliasedSymbol, java.lang.Cloneable
Known Direct Subclasses
com.jogamp.gluegen.cgram.types.StructType, com.jogamp.gluegen.cgram.types.UnionType
Imports
java.util.*, com.jogamp.gluegen.ASTLocusTag

Models all compound types, i.e., those containing fields: structs and unions. The boolean type accessors indicate how the type is really defined.

Field Summary

Modifier and TypeField and Description
private boolean
private ArrayList<Field>
private final String
private boolean

Constructor Summary

AccessConstructor and Description
pack-priv
CompoundType(final String name, final SizeThunk size, final int cvAttributes, final String structName, final ASTLocusTag astLocus)

pack-priv
CompoundType(final CompoundType o, final int cvAttributes, final ASTLocusTag astLocus)

Method Summary

Modifier and TypeMethod and Description
public void
addAliasedName(final String
the new alias to be added, maybe null
origName
)

Implements com.jogamp.gluegen.cgram.types.AliasedSymbol.addAliasedName.

Add the given origName to the list of aliases if not equal current-name.
public void
addField(final Field f)

Adds a field to this type.

public CompoundType
asCompound()

Overrides com.jogamp.gluegen.cgram.types.Type.asCompound.

Casts this to a CompoundType or returns null if not a CompoundType.
public static CompoundType
create(final String
struct name of this CompoundType, i.e. the "foo" in the construct struct foo { int a, ... }; or struct foo; even for anonymous structs.
structName
,
final SizeThunk size, final CompoundTypeKind kind, final int cvAttributes, final ASTLocusTag astLocus)

protected boolean
protected boolean
public Set<String>
getAliasedNames()

Implements com.jogamp.gluegen.cgram.types.AliasedSymbol.getAliasedNames.

Return all aliases for this symbol, i.e. original names, for this symbol.
public String
public String
getCName(final boolean includeCVAttrs)

Overrides com.jogamp.gluegen.cgram.types.Type.getCName.

Returns the name of this type, optionally including const/volatile attributes.
public Field
getField(final int i)

Returns the ith field of this type.

pack-priv ArrayList<Field>
public int
getNumFields()

Returns the number of fields in this type.

public String
getOrigName()

Implements com.jogamp.gluegen.cgram.types.AliasedSymbol.getOrigName.

Return the original-name as set at creation.
public String
getStructName()

Returns the struct name of this CompoundType, i.e. the "foo" in the construct "struct foo { ...

public String
public boolean
hasAliases()

Implements com.jogamp.gluegen.cgram.types.AliasedSymbol.hasAliases.

Returns true if this symbol has aliases, i.e. either being renamed or aliases-added.
protected int
protected int
public abstract boolean
isStruct()

Indicates whether this type was declared as a struct.

public abstract boolean
isUnion()

Indicates whether this type was declared as a union.

public void
rename(final String
the new current-name, maybe null
newName
)

Implements com.jogamp.gluegen.cgram.types.AliasedSymbol.rename.

Rename this symbol with the given newName if not equal current-name.
public void
setBodyParsed()

Indicates to this CompoundType that its body has been parsed and that no more addField operations will be made.

pack-priv void
setFields(final ArrayList<Field> fields)

public String
toString()

Overrides com.jogamp.gluegen.cgram.types.Type.toString.

Returns a string representation of this type.
public void
visit(final TypeVisitor arg)

Overrides com.jogamp.gluegen.cgram.types.Type.visit.

Traverse this Type and all of its component types; for example, the return type and argument types of a FunctionType.
Inherited from com.jogamp.gluegen.cgram.types.MemoryLayoutType:
isLayoutedsetLayouted

Field Detail

bodyParsedback to summary
private boolean bodyParsed
fieldsback to summary
private ArrayList<Field> fields
structNameback to summary
private final String structName
visitingback to summary
private boolean visiting

Constructor Detail

CompoundTypeback to summary
pack-priv CompoundType(final String name, final SizeThunk size, final int cvAttributes, final String structName, final ASTLocusTag astLocus)
CompoundTypeback to summary
pack-priv CompoundType(final CompoundType o, final int cvAttributes, final ASTLocusTag astLocus)

Method Detail

addAliasedNameback to summary
public void addAliasedName(final String origName)

Implements com.jogamp.gluegen.cgram.types.AliasedSymbol.addAliasedName.

Doc from com.jogamp.gluegen.cgram.types.AliasedSymbol.addAliasedName.

Add the given origName to the list of aliases if not equal current-name.

Operation will be ignored if newName is null.

Parameters
origName:String

the new alias to be added, maybe null

Annotations
@Override
addFieldback to summary
public void addField(final Field f)

Adds a field to this type.

asCompoundback to summary
public CompoundType asCompound()

Overrides com.jogamp.gluegen.cgram.types.Type.asCompound.

Doc from com.jogamp.gluegen.cgram.types.Type.asCompound.

Casts this to a CompoundType or returns null if not a CompoundType.

Annotations
@Override
createback to summary
public static CompoundType create(final String structName, final SizeThunk size, final CompoundTypeKind kind, final int cvAttributes, final ASTLocusTag astLocus)
Parameters
structName:String

struct name of this CompoundType, i.e. the "foo" in the construct struct foo { int a, ... }; or struct foo; even for anonymous structs.

equalSemanticsImplback to summary
protected boolean equalSemanticsImpl(final Type arg)

Implements abstract com.jogamp.gluegen.cgram.types.Type.equalSemanticsImpl.

Annotations
@Override
equalsImplback to summary
protected boolean equalsImpl(final Type arg)

Implements abstract com.jogamp.gluegen.cgram.types.Type.equalsImpl.

Annotations
@Override
getAliasedNamesback to summary
public Set<String> getAliasedNames()

Implements com.jogamp.gluegen.cgram.types.AliasedSymbol.getAliasedNames.

Doc from com.jogamp.gluegen.cgram.types.AliasedSymbol.getAliasedNames.

Return all aliases for this symbol, i.e. original names, for this symbol.

Inclusive original-name, if renamed,

Exclusive current-name.

May return null or a zero sized Set for no aliases.

Annotations
@Override
getAliasedStringback to summary
public String getAliasedString()

Implements com.jogamp.gluegen.cgram.types.AliasedSymbol.getAliasedString.

Doc from com.jogamp.gluegen.cgram.types.AliasedSymbol.getAliasedString.

Return this object's toString() wrapped w/ the current-name and all aliases.

Annotations
@Override
getCNameback to summary
public String getCName(final boolean includeCVAttrs)

Overrides com.jogamp.gluegen.cgram.types.Type.getCName.

Doc from com.jogamp.gluegen.cgram.types.Type.getCName.

Returns the name of this type, optionally including const/volatile attributes. The returned string is suitable for use as a type specifier for native C.

Annotations
@Override
getFieldback to summary
public Field getField(final int i)

Returns the ith field of this type.

getFieldsback to summary
pack-priv ArrayList<Field> getFields()
getNumFieldsback to summary
public int getNumFields()

Returns the number of fields in this type.

getOrigNameback to summary
public String getOrigName()

Implements com.jogamp.gluegen.cgram.types.AliasedSymbol.getOrigName.

Doc from com.jogamp.gluegen.cgram.types.AliasedSymbol.getOrigName.

Return the original-name as set at creation.

Annotations
@Override
getStructNameback to summary
public String getStructName()

Returns the struct name of this CompoundType, i.e. the "foo" in the construct "struct foo { ... };".

getStructStringback to summary
public String getStructString()
hasAliasesback to summary
public boolean hasAliases()

Implements com.jogamp.gluegen.cgram.types.AliasedSymbol.hasAliases.

Doc from com.jogamp.gluegen.cgram.types.AliasedSymbol.hasAliases.

Returns true if this symbol has aliases, i.e. either being renamed or aliases-added.

Otherwise false is being returned.

Annotations
@Override
hashCodeImplback to summary
protected int hashCodeImpl()

Implements abstract com.jogamp.gluegen.cgram.types.Type.hashCodeImpl.

Annotations
@Override
hashCodeSemanticsImplback to summary
protected int hashCodeSemanticsImpl()

Implements abstract com.jogamp.gluegen.cgram.types.Type.hashCodeSemanticsImpl.

Annotations
@Override
isStructback to summary
public abstract boolean isStruct()

Indicates whether this type was declared as a struct.

isUnionback to summary
public abstract boolean isUnion()

Indicates whether this type was declared as a union.

renameback to summary
public void rename(final String newName)

Implements com.jogamp.gluegen.cgram.types.AliasedSymbol.rename.

Doc from com.jogamp.gluegen.cgram.types.AliasedSymbol.rename.

Rename this symbol with the given 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.

Parameters
newName:String

the new current-name, maybe null

Annotations
@Override
setBodyParsedback to summary
public void setBodyParsed() throws IllegalStateException

Indicates to this CompoundType that its body has been parsed and that no more addField operations will be made.

Exceptions
IllegalStateException:
If called twice.
setFieldsback to summary
pack-priv void setFields(final ArrayList<Field> fields)
toStringback to summary
public String toString()

Overrides com.jogamp.gluegen.cgram.types.Type.toString.

Doc from com.jogamp.gluegen.cgram.types.Type.toString.

Returns a string representation of this type. The returned string is suitable for use as a type specifier for native C. It does contain an expanded description of structs/unions, hence may not be suitable for type declarations.

Returns:String

Doc from java.lang.Object.toString.

a string representation of the object

Annotations
@Override
visitback to summary
public void visit(final TypeVisitor arg)

Overrides com.jogamp.gluegen.cgram.types.Type.visit.

Doc from com.jogamp.gluegen.cgram.types.Type.visit.

Traverse this Type and all of its component types; for example, the return type and argument types of a FunctionType.

Annotations
@Override