41package com.jogamp.gluegen.cgram.types;
43import com.jogamp.common.os.MachineDataInfo;
44import com.jogamp.gluegen.GlueGen;
54 private final int baseOffset;
57 this.baseOffset = baseOffset;
78 for (
int i = 0; i < n; i++) {
107 if (compoundElementType !=
null) {
111 arrayType.recomputeSize();
125 throw new RuntimeException(
"Complicated field types (" + ft +
128 ") not implemented yet");
139 t.setSize(curOffset);
Machine data description for alignment and size onle, see com.jogamp.gluegen.
Glue code generator for C functions and data structures.
Represents an array type.
final Type getBaseType()
Helper method to returns the bottom-most element type of this type, i.e.
Models all compound types, i.e., those containing fields: structs and unions.
Field getField(final int i)
Returns the ith field of this type.
int getNumFields()
Returns the number of fields in this type.
String toString()
Returns a string representation of this type.
abstract boolean isUnion()
Indicates whether this type was declared as a union.
Represents a field in a struct or union.
SizeThunk getOffset()
SizeThunk computing offset, in bytes, of this field in the containing data structure.
String getName()
Name of this field in the containing data structure.
Type getType()
Type of this field.
void setOffset(final SizeThunk offset)
Sets the offset of this field in the containing data structure.
Provides a level of indirection between the definition of a type's size and the absolute value of thi...
static SizeThunk max(final SizeThunk thunk1, final SizeThunk thunk2)
abstract long computeSize(MachineDataInfo machDesc)
static SizeThunk add(final SizeThunk thunk1, final SizeThunk thunk2)
static SizeThunk constant(final int constant)
static SizeThunk align(final SizeThunk offsetThunk, final SizeThunk alignmentThunk)
Encapsulates algorithm for laying out data structures.
void layout(final CompoundType t)
static StructLayout create(final int baseOffset)
static void layout(final int baseOffset, final CompoundType t)
StructLayout(final int baseOffset)
final boolean isArray()
Indicates whether this is an ArrayType.
final boolean isInt()
Indicates whether this is an IntType.
final boolean isFloat()
Indicates whether this is a FloatType.
final SizeThunk getSize()
SizeThunk which computes size of this type in bytes.
final boolean isDouble()
Indicates whether this is a DoubleType.
final String getDebugString()
ArrayType asArray()
Casts this to an ArrayType or returns null if not an ArrayType.
final boolean isPointer()
Indicates whether this is a PointerType.
CompoundType asCompound()
Casts this to a CompoundType or returns null if not a CompoundType.
final boolean isCompound()
Indicates whether this is a CompoundType.
Static enumeration of MachineDataInfo instances used for high performance data size and alignment loo...
String getName()
Return the current-name, which is the last renamed-name if issued, or the original-name.