|
GlueGen v2.6.0-rc-20250712
GlueGen, Native Binding Generator for Java (public API).
|
Models a C type. More...
Public Member Functions | |
| final Type | newCVVariant (final int cvAttributes) |
| Return a variant of this type matching the given const/volatile attributes. More... | |
| Type | clone (final ASTLocusTag newLoc) |
Clones this instance using a new ASTLocusTag. More... | |
| final ASTLocusTag | getASTLocusTag () |
Returns this instance's ASTLocusTag, if available, otherwise returns null. More... | |
| boolean | isAnon () |
| final String | getCName () |
| Returns the name of this type. More... | |
| String | getCName (final boolean includeCVAttrs) |
| Returns the name of this type, optionally including const/volatile attributes. More... | |
| final String | getName () |
| Returns the name of this type. More... | |
| String | getName (final boolean includeCVAttrs) |
| Returns the name of this type, optionally including const/volatile attributes. More... | |
| String | toString () |
| Returns a string representation of this type. More... | |
| final StringBuilder | getSignature (StringBuilder sb) |
| final String | getDebugString () |
| boolean | setTypedefName (final String name) |
Set the typedef name of this type and renders this type a typedef, if given name has a length. More... | |
| final boolean | isTypedef () |
| Indicates whether this type is a typedef type, i.e. More... | |
| final boolean | hasSize () |
Returns true if getSize() is not null, otherwise false. More... | |
| final SizeThunk | getSize () |
| SizeThunk which computes size of this type in bytes. More... | |
| final long | getSize (final MachineDataInfo machDesc) |
| Size of this type in bytes according to the given MachineDataInfo. More... | |
| BitType | asBit () |
| Casts this to a BitType or returns null if not a BitType. More... | |
| IntType | asInt () |
| Casts this to an IntType or returns null if not an IntType. More... | |
| EnumType | asEnum () |
| Casts this to an EnumType or returns null if not an EnumType. More... | |
| FloatType | asFloat () |
| Casts this to a FloatType or returns null if not a FloatType. More... | |
| DoubleType | asDouble () |
| Casts this to a DoubleType or returns null if not a DoubleType. More... | |
| PointerType | asPointer () |
| Casts this to a PointerType or returns null if not a PointerType. More... | |
| ArrayType | asArray () |
| Casts this to an ArrayType or returns null if not an ArrayType. More... | |
| CompoundType | asCompound () |
| Casts this to a CompoundType or returns null if not a CompoundType. More... | |
| FunctionType | asFunction () |
| Casts this to a FunctionType or returns null if not a FunctionType. More... | |
| VoidType | asVoid () |
| Casts this to a VoidType or returns null if not a VoidType. More... | |
| final boolean | isBit () |
| Indicates whether this is a BitType. More... | |
| final boolean | isInt () |
| Indicates whether this is an IntType. More... | |
| final boolean | isEnum () |
| Indicates whether this is an EnumType. More... | |
| final boolean | isFloat () |
| Indicates whether this is a FloatType. More... | |
| final boolean | isDouble () |
| Indicates whether this is a DoubleType. More... | |
| final boolean | isPointer () |
| Indicates whether this is a PointerType. More... | |
| final boolean | isArray () |
| Indicates whether this is an ArrayType. More... | |
| final boolean | isCompound () |
| Indicates whether this is a CompoundType. More... | |
| final boolean | isFunction () |
| Indicates whether this is a FunctionType. More... | |
| final boolean | isVoid () |
| Indicates whether this is a VoidType. More... | |
| final boolean | isVolatile () |
| Indicates whether this type is volatile. More... | |
| final boolean | isConst () |
| Indicates whether this type is const. More... | |
| boolean | isPrimitive () |
| Indicates whether this type is a primitive type. More... | |
| boolean | isFunctionPointer () |
| Convenience routine indicating whether this Type is a pointer to a function. More... | |
| final boolean | isBaseTypeConst () |
| Checks the base type of pointer-to-pointer, pointer, array or plain for const-ness. More... | |
| final int | hashCode () |
| Hashcode for Types. More... | |
| final boolean | equals (final Object arg) |
Equality test for Types inclusive its given name. More... | |
| final int | hashCodeSemantics () |
Semantic hashcode for Types exclusive its given name. More... | |
| final boolean | equalSemantics (final SemanticEqualityOp arg) |
Semantic equality test for Types exclusive its given name. More... | |
| void | visit (final TypeVisitor visitor) |
Traverse this Type and all of its component types; for example, the return type and argument types of a FunctionType. More... | |
| final int | getCVAttributes () |
| final String | getCVAttributesString () |
| Returns a string indicating the const/volatile attributes of this type. More... | |
| int | pointerDepth () |
| Helper method for determining how many pointer indirections this type represents (i.e., "void **" returns 2). More... | |
| int | arrayDimension () |
| Helper method for determining how many array dimentions this type represents (i.e., "char[][]" returns 2). More... | |
| Type | getBaseType () |
| Helper method to returns the bottom-most element type of this type, i.e. More... | |
| Type | getTargetType () |
| Helper method to returns the target type of this type, in case another type is being referenced, i.e. More... | |
| Type | getArrayBaseOrPointerTargetType () |
Return getBaseType() if isArray() or returns getTargetType() otherwise. More... | |
| FunctionType | getTargetFunction () |
Returns the target FunctionType if this type is isFunctionPointer(). More... | |
| int | hashCodeSemantics () |
Semantic hashcode for Types exclusive its given name. More... | |
| boolean | equalSemantics (final SemanticEqualityOp arg) |
Semantic equality test for Types exclusive its given name. More... | |
| ASTLocusTag | getASTLocusTag () |
Returns this instance's ASTLocusTag, if available, otherwise returns null. More... | |
Public Attributes | |
| final boolean | relaxedEqSem |
Protected Member Functions | |
| Type (final String name, final SizeThunk size, final int cvAttributes, final ASTLocusTag astLocus) | |
| final void | clearCache () |
| abstract int | hashCodeImpl () |
| abstract boolean | equalsImpl (final Type t) |
| abstract int | hashCodeSemanticsImpl () |
| abstract boolean | equalSemanticsImpl (final Type t) |
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.
|
protected |
| int com.jogamp.gluegen.cgram.types.Type.arrayDimension | ( | ) |
Helper method for determining how many array dimentions this type represents (i.e., "char[][]" returns 2).
Returns 0 if this type is not an array type.
Reimplemented in com.jogamp.gluegen.cgram.types.ArrayType.
Definition at line 571 of file Type.java.
| ArrayType com.jogamp.gluegen.cgram.types.Type.asArray | ( | ) |
Casts this to an ArrayType or returns null if not an ArrayType.
Reimplemented in com.jogamp.gluegen.cgram.types.ArrayType.
Definition at line 388 of file Type.java.
| BitType com.jogamp.gluegen.cgram.types.Type.asBit | ( | ) |
Casts this to a BitType or returns null if not a BitType.
Reimplemented in com.jogamp.gluegen.cgram.types.BitType.
Definition at line 376 of file Type.java.
| CompoundType com.jogamp.gluegen.cgram.types.Type.asCompound | ( | ) |
Casts this to a CompoundType or returns null if not a CompoundType.
Reimplemented in com.jogamp.gluegen.cgram.types.CompoundType.
Definition at line 390 of file Type.java.
| DoubleType com.jogamp.gluegen.cgram.types.Type.asDouble | ( | ) |
Casts this to a DoubleType or returns null if not a DoubleType.
Reimplemented in com.jogamp.gluegen.cgram.types.DoubleType.
Definition at line 384 of file Type.java.
| EnumType com.jogamp.gluegen.cgram.types.Type.asEnum | ( | ) |
Casts this to an EnumType or returns null if not an EnumType.
Reimplemented in com.jogamp.gluegen.cgram.types.EnumType.
Definition at line 380 of file Type.java.
| FloatType com.jogamp.gluegen.cgram.types.Type.asFloat | ( | ) |
Casts this to a FloatType or returns null if not a FloatType.
Reimplemented in com.jogamp.gluegen.cgram.types.FloatType.
Definition at line 382 of file Type.java.
| FunctionType com.jogamp.gluegen.cgram.types.Type.asFunction | ( | ) |
Casts this to a FunctionType or returns null if not a FunctionType.
Reimplemented in com.jogamp.gluegen.cgram.types.FunctionType.
Definition at line 392 of file Type.java.
| IntType com.jogamp.gluegen.cgram.types.Type.asInt | ( | ) |
Casts this to an IntType or returns null if not an IntType.
Reimplemented in com.jogamp.gluegen.cgram.types.IntType.
Definition at line 378 of file Type.java.
| PointerType com.jogamp.gluegen.cgram.types.Type.asPointer | ( | ) |
Casts this to a PointerType or returns null if not a PointerType.
Reimplemented in com.jogamp.gluegen.cgram.types.PointerType.
Definition at line 386 of file Type.java.
| VoidType com.jogamp.gluegen.cgram.types.Type.asVoid | ( | ) |
Casts this to a VoidType or returns null if not a VoidType.
Reimplemented in com.jogamp.gluegen.cgram.types.VoidType.
Definition at line 394 of file Type.java.
|
protected |
| Type com.jogamp.gluegen.cgram.types.Type.clone | ( | final ASTLocusTag | newLoc | ) |
Clones this instance using a new ASTLocusTag.
Definition at line 109 of file Type.java.
| final boolean com.jogamp.gluegen.cgram.types.Type.equals | ( | final Object | arg | ) |
| final boolean com.jogamp.gluegen.cgram.types.Type.equalSemantics | ( | final SemanticEqualityOp | arg | ) |
Semantic equality test for Types exclusive its given name.
Implements com.jogamp.gluegen.cgram.types.TypeComparator.SemanticEqualityOp.
Definition at line 514 of file Type.java.
|
abstractprotected |
Reimplemented in com.jogamp.gluegen.cgram.types.ArrayType, com.jogamp.gluegen.cgram.types.BitType, com.jogamp.gluegen.cgram.types.CompoundType, com.jogamp.gluegen.cgram.types.EnumType, com.jogamp.gluegen.cgram.types.FunctionType, com.jogamp.gluegen.cgram.types.IntType, com.jogamp.gluegen.cgram.types.PointerType, com.jogamp.gluegen.cgram.types.DoubleType, com.jogamp.gluegen.cgram.types.FloatType, and com.jogamp.gluegen.cgram.types.VoidType.
|
abstractprotected |
Reimplemented in com.jogamp.gluegen.cgram.types.ArrayType, com.jogamp.gluegen.cgram.types.BitType, com.jogamp.gluegen.cgram.types.CompoundType, com.jogamp.gluegen.cgram.types.EnumType, com.jogamp.gluegen.cgram.types.FunctionType, com.jogamp.gluegen.cgram.types.IntType, com.jogamp.gluegen.cgram.types.PointerType, com.jogamp.gluegen.cgram.types.DoubleType, com.jogamp.gluegen.cgram.types.FloatType, and com.jogamp.gluegen.cgram.types.VoidType.
| Type com.jogamp.gluegen.cgram.types.Type.getArrayBaseOrPointerTargetType | ( | ) |
Return getBaseType() if isArray() or returns getTargetType() otherwise.
Reimplemented in com.jogamp.gluegen.cgram.types.ArrayType, and com.jogamp.gluegen.cgram.types.PointerType.
Definition at line 612 of file Type.java.
| final ASTLocusTag com.jogamp.gluegen.cgram.types.Type.getASTLocusTag | ( | ) |
Returns this instance's ASTLocusTag, if available, otherwise returns null.
Implements com.jogamp.gluegen.ASTLocusTag.ASTLocusTagProvider.
Definition at line 125 of file Type.java.
| Type com.jogamp.gluegen.cgram.types.Type.getBaseType | ( | ) |
Helper method to returns the bottom-most element type of this type, i.e.
returns @iliteral{code} type @endiliteral if this-type is @iliteral{code} type @endiliteral *, @iliteral{code} type @endiliteral **, @iliteral{code} type @endiliteral [] or @iliteral{code} type @endiliteral [][].
If this is a multidimensional array or pointer method returns the bottom-most element type, otherwise this.
In case a isFunctionPointer() type is reached, traversing ends and the function PointerType is returned.
Reimplemented in com.jogamp.gluegen.cgram.types.ArrayType, and com.jogamp.gluegen.cgram.types.PointerType.
Definition at line 588 of file Type.java.
| final String com.jogamp.gluegen.cgram.types.Type.getCName | ( | ) |
| String com.jogamp.gluegen.cgram.types.Type.getCName | ( | final boolean | includeCVAttrs | ) |
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.
Reimplemented in com.jogamp.gluegen.cgram.types.CompoundType, com.jogamp.gluegen.cgram.types.IntType, and com.jogamp.gluegen.cgram.types.PointerType.
Definition at line 137 of file Type.java.
| final int com.jogamp.gluegen.cgram.types.Type.getCVAttributes | ( | ) |
| final String com.jogamp.gluegen.cgram.types.Type.getCVAttributesString | ( | ) |
| final String com.jogamp.gluegen.cgram.types.Type.getDebugString | ( | ) |
| final String com.jogamp.gluegen.cgram.types.Type.getName | ( | ) |
| String com.jogamp.gluegen.cgram.types.Type.getName | ( | final boolean | includeCVAttrs | ) |
Returns the name of this type, optionally including const/volatile attributes.
The returned string is suitable for use as a type specifier for Java.
Reimplemented in com.jogamp.gluegen.cgram.types.ArrayType, and com.jogamp.gluegen.cgram.types.PointerType.
Definition at line 147 of file Type.java.
| final StringBuilder com.jogamp.gluegen.cgram.types.Type.getSignature | ( | StringBuilder | sb | ) |
| final SizeThunk com.jogamp.gluegen.cgram.types.Type.getSize | ( | ) |
| final long com.jogamp.gluegen.cgram.types.Type.getSize | ( | final MachineDataInfo | machDesc | ) |
| FunctionType com.jogamp.gluegen.cgram.types.Type.getTargetFunction | ( | ) |
Returns the target FunctionType if this type is isFunctionPointer().
Reimplemented in com.jogamp.gluegen.cgram.types.PointerType.
Definition at line 619 of file Type.java.
| Type com.jogamp.gluegen.cgram.types.Type.getTargetType | ( | ) |
Helper method to returns the target type of this type, in case another type is being referenced, i.e.
returns @iliteral{code} type @endiliteral if this-type is @iliteral{code} type @endiliteral * or @iliteral{code} type @endiliteral [] and returns @iliteral{code} type @endiliteral * if this-type is @iliteral{code} type @endiliteral ** or @iliteral{code} type @endiliteral [][].
If this is an array or pointer method returns the next target element type, otherwise this.
In this is a isFunctionPointer() type, this function PointerType is returned.
Reimplemented in com.jogamp.gluegen.cgram.types.ArrayType, and com.jogamp.gluegen.cgram.types.PointerType.
Definition at line 605 of file Type.java.
| final int com.jogamp.gluegen.cgram.types.Type.hashCode | ( | ) |
|
abstractprotected |
Reimplemented in com.jogamp.gluegen.cgram.types.ArrayType, com.jogamp.gluegen.cgram.types.BitType, com.jogamp.gluegen.cgram.types.CompoundType, com.jogamp.gluegen.cgram.types.DoubleType, com.jogamp.gluegen.cgram.types.EnumType, com.jogamp.gluegen.cgram.types.FloatType, com.jogamp.gluegen.cgram.types.FunctionType, com.jogamp.gluegen.cgram.types.IntType, com.jogamp.gluegen.cgram.types.PointerType, and com.jogamp.gluegen.cgram.types.VoidType.
| final int com.jogamp.gluegen.cgram.types.Type.hashCodeSemantics | ( | ) |
Semantic hashcode for Types exclusive its given name.
Implements com.jogamp.gluegen.cgram.types.TypeComparator.SemanticEqualityOp.
Definition at line 497 of file Type.java.
|
abstractprotected |
Reimplemented in com.jogamp.gluegen.cgram.types.ArrayType, com.jogamp.gluegen.cgram.types.BitType, com.jogamp.gluegen.cgram.types.CompoundType, com.jogamp.gluegen.cgram.types.DoubleType, com.jogamp.gluegen.cgram.types.EnumType, com.jogamp.gluegen.cgram.types.FloatType, com.jogamp.gluegen.cgram.types.FunctionType, com.jogamp.gluegen.cgram.types.IntType, com.jogamp.gluegen.cgram.types.PointerType, and com.jogamp.gluegen.cgram.types.VoidType.
| final boolean com.jogamp.gluegen.cgram.types.Type.hasSize | ( | ) |
| boolean com.jogamp.gluegen.cgram.types.Type.isAnon | ( | ) |
Reimplemented in com.jogamp.gluegen.cgram.types.ArrayType, and com.jogamp.gluegen.cgram.types.PointerType.
Definition at line 127 of file Type.java.
| final boolean com.jogamp.gluegen.cgram.types.Type.isArray | ( | ) |
| final boolean com.jogamp.gluegen.cgram.types.Type.isBaseTypeConst | ( | ) |
| final boolean com.jogamp.gluegen.cgram.types.Type.isBit | ( | ) |
| final boolean com.jogamp.gluegen.cgram.types.Type.isCompound | ( | ) |
Indicates whether this is a CompoundType.
Definition at line 411 of file Type.java.
| final boolean com.jogamp.gluegen.cgram.types.Type.isConst | ( | ) |
| final boolean com.jogamp.gluegen.cgram.types.Type.isDouble | ( | ) |
Indicates whether this is a DoubleType.
Definition at line 405 of file Type.java.
| final boolean com.jogamp.gluegen.cgram.types.Type.isEnum | ( | ) |
| final boolean com.jogamp.gluegen.cgram.types.Type.isFloat | ( | ) |
| final boolean com.jogamp.gluegen.cgram.types.Type.isFunction | ( | ) |
Indicates whether this is a FunctionType.
Definition at line 413 of file Type.java.
| boolean com.jogamp.gluegen.cgram.types.Type.isFunctionPointer | ( | ) |
Convenience routine indicating whether this Type is a pointer to a function.
Reimplemented in com.jogamp.gluegen.cgram.types.PointerType.
Definition at line 430 of file Type.java.
| final boolean com.jogamp.gluegen.cgram.types.Type.isInt | ( | ) |
| final boolean com.jogamp.gluegen.cgram.types.Type.isPointer | ( | ) |
Indicates whether this is a PointerType.
Definition at line 407 of file Type.java.
| boolean com.jogamp.gluegen.cgram.types.Type.isPrimitive | ( | ) |
Indicates whether this type is a primitive type.
Reimplemented in com.jogamp.gluegen.cgram.types.PrimitiveType.
Definition at line 426 of file Type.java.
| final boolean com.jogamp.gluegen.cgram.types.Type.isTypedef | ( | ) |
Indicates whether this type is a typedef type, i.e.
declared via setTypedefName(String).
Definition at line 352 of file Type.java.
| final boolean com.jogamp.gluegen.cgram.types.Type.isVoid | ( | ) |
| final boolean com.jogamp.gluegen.cgram.types.Type.isVolatile | ( | ) |
| final Type com.jogamp.gluegen.cgram.types.Type.newCVVariant | ( | final int | cvAttributes | ) |
| int com.jogamp.gluegen.cgram.types.Type.pointerDepth | ( | ) |
Helper method for determining how many pointer indirections this type represents (i.e., "void **" returns 2).
Returns 0 if this type is not a pointer type.
Reimplemented in com.jogamp.gluegen.cgram.types.PointerType.
Definition at line 564 of file Type.java.
| boolean com.jogamp.gluegen.cgram.types.Type.setTypedefName | ( | final String | name | ) |
Set the typedef name of this type and renders this type a typedef, if given name has a length.
Method issues clearCache(), to force re-evaluation of hashes.
Reimplemented in com.jogamp.gluegen.cgram.types.IntType.
Definition at line 327 of file Type.java.
| String 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.
Reimplemented in com.jogamp.gluegen.cgram.types.ArrayType, com.jogamp.gluegen.cgram.types.CompoundType, com.jogamp.gluegen.cgram.types.FunctionType, com.jogamp.gluegen.cgram.types.IntType, and com.jogamp.gluegen.cgram.types.PointerType.
Definition at line 161 of file Type.java.
| void com.jogamp.gluegen.cgram.types.Type.visit | ( | final TypeVisitor | visitor | ) |
Traverse this Type and all of its component types; for example, the return type and argument types of a FunctionType.
Reimplemented in com.jogamp.gluegen.cgram.types.ArrayType, com.jogamp.gluegen.cgram.types.BitType, com.jogamp.gluegen.cgram.types.CompoundType, com.jogamp.gluegen.cgram.types.EnumType, com.jogamp.gluegen.cgram.types.FunctionType, and com.jogamp.gluegen.cgram.types.PointerType.
Definition at line 544 of file Type.java.
| final boolean com.jogamp.gluegen.cgram.types.Type.relaxedEqSem |