Record Class Mapping.Union
java.lang.Object
java.lang.Record
org.lwjgl.system.ffm.mapping.Mapping.Union
- All Implemented Interfaces:
DataMapping<UnionLayout>, GroupMapping<UnionLayout>, Mapping<UnionLayout>
- Enclosing interface:
Mapping<L extends MemoryLayout>
public static record Mapping.Union(UnionLayout layout)
extends Record
implements GroupMapping<UnionLayout>
Mapping from
UnionLayout to a C union.
Using a UnionBinder 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
ConstructorsConstructorDescriptionUnion(UnionLayout layout) Creates an instance of aUnionrecord class.Union(String name, UnionLayout 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
-
Union
Creates an instance of aUnionrecord class.- Parameters:
layout- the value for thelayoutrecord component
-
Union
-
-
Method Details
-
withByteAlignment
Description copied from interface:DataMappingReturns a copy of this mapping with the specified byte alignment.- Specified by:
withByteAlignmentin interfaceDataMapping<UnionLayout>- Specified by:
withByteAlignmentin interfaceGroupMapping<UnionLayout>- 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<UnionLayout>- Specified by:
typedefin interfaceMapping<UnionLayout>- Returns:
- the new mapping
-
cconst
Description copied from interface:MappingCreates a new instance of this mapping with the Cconstqualifier- Specified by:
cconstin interfaceMapping<UnionLayout>- 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<UnionLayout>- Returns:
- the value of the
layoutrecord component
-