40package com.jogamp.gluegen.cgram.types;
42import com.jogamp.common.os.MachineDataInfo;
43import com.jogamp.gluegen.cgram.types.TypeComparator.SemanticEqualityOp;
48 private final String name;
49 private final Type type;
61 final int hash = 31 + (
null != name ? name.hashCode() : 0 );
62 return ((hash << 5) - hash) + type.
hashCode();
66 public boolean equals(
final Object arg) {
67 if ( !(arg instanceof
Field) ) {
74 return ( ( name !=
null && name.equals(f.name) ) ||
75 ( name ==
null && f.name == null )
87 if ( !(arg instanceof
Field) ) {
115 if (!
getType().isFunctionPointer()) {
117 getType().asCompound() !=
null &&
118 getType().asCompound().isUnion()) {
Machine data description for alignment and size onle, see com.jogamp.gluegen.
Represents a field in a struct or union.
int hashCodeSemantics()
Semantic hashcode for Types exclusive its given name.
boolean equalSemantics(final SemanticEqualityOp arg)
Semantic equality test for Types exclusive its given name.
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.
Field(final String name, final Type type, final SizeThunk offset)
boolean equals(final Object arg)
Type getType()
Type of this field.
long getOffset(final MachineDataInfo machDesc)
Offset, in bytes, of this field in the containing data structure given the specified MachineDataInfo.
void setOffset(final SizeThunk offset)
Sets the offset of this field in the containing data structure.
Describes a function type, used to model both function declarations and (via PointerType) function po...
String toString()
Returns a string representation of this type.
Provides a level of indirection between the definition of a type's size and the absolute value of thi...
abstract long computeSize(MachineDataInfo machDesc)
final int hashCodeSemantics()
Semantic hashcode for Types exclusive its given name.
final int hashCode()
Hashcode for Types.
final boolean equalSemantics(final SemanticEqualityOp arg)
Semantic equality test for Types exclusive its given name.
FunctionType getTargetFunction()
Returns the target FunctionType if this type is isFunctionPointer().
final boolean equals(final Object arg)
Equality test for Types inclusive its given name.
Supports semantic equality and hash functions for types.