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 class
EnumType.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 void
addEnum(String name, EnumType.Enumerator newEnum)
StringBuilder
appendEnums(StringBuilder sb, boolean cr)
EnumType
asEnum()
Casts this to an EnumType or returns null if not an EnumType.boolean
containsEnumerate(String name)
Does this enum type contain an enumerate with the given name?protected boolean
equalSemanticsImpl(Type arg)
protected boolean
equalsImpl(Type arg)
EnumType.Enumerator
getEnum(int i)
Fetch ith (0..getNumEnumerates() - 1)EnumType.Enumerator
EnumType.Enumerator
getEnum(String name)
Fetch the enumerate with the given name.int
getNumEnumerates()
Number of enumerates defined in this enum.Type
getUnderlyingType()
protected int
hashCodeImpl()
protected int
hashCodeSemanticsImpl()
boolean
removeEnumerate(String name)
Remove the enumerate with the given name.void
visit(TypeVisitor arg)
Traverse thisType
and 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:
hashCodeImpl
in classIntType
-
equalsImpl
protected boolean equalsImpl(Type arg)
- Overrides:
equalsImpl
in classIntType
-
hashCodeSemanticsImpl
protected int hashCodeSemanticsImpl()
- Overrides:
hashCodeSemanticsImpl
in classIntType
-
equalSemanticsImpl
protected boolean equalSemanticsImpl(Type arg)
- Overrides:
equalSemanticsImpl
in classIntType
-
asEnum
public EnumType asEnum()
Description copied from class:Type
Casts 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:Type
Traverse thisType
and all of its component types; for example, the return type and argument types of a FunctionType.
-
-