Package com.jogamp.gluegen.cgram.types
Class EnumType
- java.lang.Object
-
- com.jogamp.gluegen.cgram.types.Type
-
- com.jogamp.gluegen.cgram.types.PrimitiveType
-
- com.jogamp.gluegen.cgram.types.IntType
-
- com.jogamp.gluegen.cgram.types.EnumType
-
- All Implemented Interfaces:
ASTLocusTag.ASTLocusTagProvider,TypeComparator.SemanticEqualityOp,Cloneable
public class EnumType extends IntType implements Cloneable
Describes enumerated types. Enumerations are like ints except that they have a set of named values.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classEnumType.Enumerator
-
Field Summary
-
Fields inherited from class com.jogamp.gluegen.cgram.types.Type
relaxedEqSem
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddEnum(String name, EnumType.Enumerator newEnum)StringBuilderappendEnums(StringBuilder sb, boolean cr)EnumTypeasEnum()Casts this to an EnumType or returns null if not an EnumType.booleancontainsEnumerate(String name)Does this enum type contain an enumerate with the given name?protected booleanequalSemanticsImpl(Type arg)protected booleanequalsImpl(Type arg)EnumType.EnumeratorgetEnum(int i)Fetch ith (0..getNumEnumerates() - 1)EnumType.EnumeratorEnumType.EnumeratorgetEnum(String name)Fetch the enumerate with the given name.intgetNumEnumerates()Number of enumerates defined in this enum.TypegetUnderlyingType()protected inthashCodeImpl()protected inthashCodeSemanticsImpl()booleanremoveEnumerate(String name)Remove the enumerate with the given name.voidvisit(TypeVisitor arg)Traverse thisTypeand all of its component types; for example, the return type and argument types of a FunctionType.-
Methods inherited from class com.jogamp.gluegen.cgram.types.IntType
asInt, getCName, isUnsigned, setTypedefName, toString
-
Methods inherited from class com.jogamp.gluegen.cgram.types.PrimitiveType
isPrimitive
-
Methods inherited from class com.jogamp.gluegen.cgram.types.Type
arrayDimension, asArray, asBit, asCompound, asDouble, asFloat, asFunction, asPointer, asVoid, clearCache, clone, equals, equalSemantics, getArrayBaseOrPointerTargetType, getASTLocusTag, getBaseType, getCName, getCVAttributes, getCVAttributesString, getDebugString, getName, getName, getSignature, getSize, getSize, getTargetFunction, getTargetType, hashCode, hashCodeSemantics, hasSize, isAnon, isArray, isBaseTypeConst, isBit, isCompound, isConst, isDouble, isEnum, isFloat, isFunction, isFunctionPointer, isInt, isPointer, isTypedef, isVoid, isVolatile, newCVVariant, pointerDepth
-
-
-
-
Constructor Detail
-
EnumType
public EnumType(String name)
-
EnumType
public EnumType(String name, SizeThunk enumSizeInBytes, ASTLocusTag astLocus)
-
-
Method Detail
-
hashCodeImpl
protected int hashCodeImpl()
- Overrides:
hashCodeImplin classIntType
-
equalsImpl
protected boolean equalsImpl(Type arg)
- Overrides:
equalsImplin classIntType
-
hashCodeSemanticsImpl
protected int hashCodeSemanticsImpl()
- Overrides:
hashCodeSemanticsImplin classIntType
-
equalSemanticsImpl
protected boolean equalSemanticsImpl(Type arg)
- Overrides:
equalSemanticsImplin classIntType
-
asEnum
public EnumType asEnum()
Description copied from class:TypeCasts this to an EnumType or returns null if not an EnumType.
-
getUnderlyingType
public Type getUnderlyingType()
-
addEnum
public void addEnum(String name, EnumType.Enumerator newEnum)
-
getNumEnumerates
public int getNumEnumerates()
Number of enumerates defined in this enum.
-
getEnum
public EnumType.Enumerator getEnum(int i)
Fetch ith (0..getNumEnumerates() - 1)EnumType.Enumerator
-
getEnum
public EnumType.Enumerator getEnum(String name)
Fetch the enumerate with the given name.
-
containsEnumerate
public boolean containsEnumerate(String name)
Does this enum type contain an enumerate with the given name?
-
removeEnumerate
public boolean removeEnumerate(String name)
Remove the enumerate with the given name. Returns true if it was found and removed; false if it was not found.
-
appendEnums
public StringBuilder appendEnums(StringBuilder sb, boolean cr)
-
visit
public void visit(TypeVisitor arg)
Description copied from class:TypeTraverse thisTypeand all of its component types; for example, the return type and argument types of a FunctionType.
-
-