|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.jogamp.gluegen.cgram.types.Type
public abstract class Type
Models a C type. Primitive types include int, float, and double. All types have an associated name. Structs and unions are modeled as "compound" types -- composed of fields of primitive or other types.
Constructor Summary | |
---|---|
protected |
Type(String name,
SizeThunk size,
int cvAttributes)
|
Method Summary | |
---|---|
int |
arrayDimension()
Helper method for determining how many array dimentions this type represents (i.e., "char[][]" returns 2). |
ArrayType |
asArray()
Casts this to an ArrayType or returns null if not an ArrayType. |
BitType |
asBit()
Casts this to a BitType or returns null if not a BitType. |
CompoundType |
asCompound()
Casts this to a CompoundType or returns null if not a CompoundType. |
DoubleType |
asDouble()
Casts this to a DoubleType or returns null if not a DoubleType. |
EnumType |
asEnum()
Casts this to an EnumType or returns null if not an EnumType. |
FloatType |
asFloat()
Casts this to a FloatType or returns null if not a FloatType. |
FunctionType |
asFunction()
Casts this to a FunctionType or returns null if not a FunctionType. |
IntType |
asInt()
Casts this to an IntType or returns null if not an IntType. |
PointerType |
asPointer()
Casts this to a PointerType or returns null if not a PointerType. |
VoidType |
asVoid()
Casts this to a VoidType or returns null if not a VoidType. |
Object |
clone()
|
boolean |
equals(Object arg)
Equality test for Types. |
int |
getCVAttributes()
|
String |
getCVAttributesString()
Returns a string indicating the const/volatile attributes of this type. |
Type |
getCVVariant(int cvAttributes)
Return a variant of this type matching the given const/volatile attributes. |
String |
getName()
Returns the name of this type. |
String |
getName(boolean includeCVAttrs)
Returns the name of this type, optionally including const/volatile attributes. |
SizeThunk |
getSize()
SizeThunk which computes size of this type in bytes. |
long |
getSize(MachineDescription machDesc)
Size of this type in bytes according to the given MachineDescription. |
int |
hashCode()
Hashcode for Types. |
boolean |
hasTypedefName()
Indicates whether setName() has been called on this type, indicating that it already has a typedef name. |
boolean |
isArray()
Indicates whether this is an ArrayType. |
boolean |
isBit()
Indicates whether this is a BitType. |
boolean |
isCompound()
Indicates whether this is a CompoundType. |
boolean |
isConst()
Indicates whether this type is const. |
boolean |
isDouble()
Indicates whether this is a DoubleType. |
boolean |
isEnum()
Indicates whether this is an EnumType. |
boolean |
isFloat()
Indicates whether this is a FloatType. |
boolean |
isFunction()
Indicates whether this is a FunctionType. |
boolean |
isFunctionPointer()
Convenience routine indicating whether this Type is a pointer to a function. |
boolean |
isInt()
Indicates whether this is an IntType. |
boolean |
isPointer()
Indicates whether this is a PointerType. |
boolean |
isPrimitive()
Indicates whether this type is a primitive type. |
boolean |
isVoid()
Indicates whether this is a VoidType. |
boolean |
isVolatile()
Indicates whether this type is volatile. |
int |
pointerDepth()
Helper method for determining how many pointer indirections this type represents (i.e., "void **" returns 2). |
void |
setName(String name)
Set the name of this type; used for handling typedefs. |
String |
toString()
Returns a string representation of this type. |
void |
visit(TypeVisitor visitor)
Visit this type and all of the component types of this one; for example, the return type and argument types of a FunctionType. |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected Type(String name, SizeThunk size, int cvAttributes)
Method Detail |
---|
public Object clone()
clone
in class Object
public String getName()
public String getName(boolean includeCVAttrs)
public void setName(String name)
public SizeThunk getSize()
public long getSize(MachineDescription machDesc)
public BitType asBit()
public IntType asInt()
public EnumType asEnum()
public FloatType asFloat()
public DoubleType asDouble()
public PointerType asPointer()
public ArrayType asArray()
public CompoundType asCompound()
public FunctionType asFunction()
public VoidType asVoid()
public boolean isBit()
public boolean isInt()
public boolean isEnum()
public boolean isFloat()
public boolean isDouble()
public boolean isPointer()
public boolean isArray()
public boolean isCompound()
public boolean isFunction()
public boolean isVoid()
public boolean isConst()
public boolean isVolatile()
public boolean isPrimitive()
public boolean isFunctionPointer()
public int hashCode()
hashCode
in class Object
public boolean equals(Object arg)
equals
in class Object
public String toString()
toString
in class Object
public void visit(TypeVisitor visitor)
public final int getCVAttributes()
public final String getCVAttributesString()
public final Type getCVVariant(int cvAttributes)
public boolean hasTypedefName()
public int pointerDepth()
public int arrayDimension()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |