Record Class Mapping.Struct
java.lang.Object
java.lang.Record
org.lwjgl.system.ffm.mapping.Mapping.Struct
- All Implemented Interfaces:
DataMapping<StructLayout>, GroupMapping<StructLayout>, Mapping<StructLayout>
- Enclosing interface:
Mapping<L extends MemoryLayout>
public static record Mapping.Struct(StructLayout layout)
extends Record
implements GroupMapping<StructLayout>
Mapping from
StructLayout to a C struct.
Using a StructBinder directly is usually preferred over this mapping.
-
Nested Class Summary
Nested classes/interfaces inherited from interface Mapping
Mapping.Boolean, Mapping.Byte, Mapping.Char, Mapping.CLong, Mapping.Double, Mapping.Float, Mapping.Int, Mapping.Long, Mapping.Opaque, Mapping.Pointer, Mapping.Sequence, Mapping.Short, Mapping.Size, Mapping.Struct, Mapping.Union -
Constructor Summary
ConstructorsConstructorDescriptionStruct(StructLayout layout) Creates an instance of aStructrecord class.Struct(String name, StructLayout layout) -
Method Summary
Modifier and TypeMethodDescriptioncconst()Creates a new instance of this mapping with the Cconstqualifierfinal booleanIndicates whether some other object is "equal to" this one.final inthashCode()Returns a hash code value for this object.layout()Returns the value of thelayoutrecord component.final StringtoString()Returns a string representation of this record class.Creates a new instance of this mapping with the specified type name.withByteAlignment(long byteAlignment) Returns a copy of this mapping with the specified byte alignment.Methods inherited from interface DataMapping
allocateSegment, allocateSegment, allocateSegment, allocateSegment, array, mallocSegment, mallocSegment
-
Constructor Details
-
Struct
Creates an instance of aStructrecord class.- Parameters:
layout- the value for thelayoutrecord component
-
Struct
-
-
Method Details
-
withByteAlignment
Description copied from interface:DataMappingReturns a copy of this mapping with the specified byte alignment.- Specified by:
withByteAlignmentin interfaceDataMapping<StructLayout>- Specified by:
withByteAlignmentin interfaceGroupMapping<StructLayout>- Parameters:
byteAlignment- the new byte alignment- Returns:
- the new mapping
-
typedef
Description copied from interface:MappingCreates a new instance of this mapping with the specified type name.- Specified by:
typedefin interfaceGroupMapping<StructLayout>- Specified by:
typedefin interfaceMapping<StructLayout>- Returns:
- the new mapping
-
cconst
Description copied from interface:MappingCreates a new instance of this mapping with the Cconstqualifier- Specified by:
cconstin interfaceMapping<StructLayout>- Returns:
- the new mapping
-
toString
-
hashCode
-
equals
Indicates whether some other object is "equal to" this one. The objects are equal if the other object is of the same class and if all the record components are equal. All components in this record class are compared withObjects::equals(Object,Object). -
layout
Returns the value of thelayoutrecord component.- Specified by:
layoutin interfaceMapping<StructLayout>- Returns:
- the value of the
layoutrecord component
-