java.lang.Object
overrungl.Pointer
overrungl.Struct
- All Implemented Interfaces:
Addressable
- Direct Known Subclasses:
DrawArraysIndirectCommand
,DrawElementsIndirectCommand
,GLFWGamepadState
,GLFWGammaRamp
,GLFWImage
,GLFWVidMode
,NFDEnumerator
,NFDNFilterItem
,NFDU8FilterItem
,STBIIoCallbacks
Struct
relies on preview features of the Java platform:
Struct
refers to one or more preview APIs:MemoryLayout
,MemorySegment
,SegmentAllocator
.
Preview features may be removed in a future release, or upgraded to permanent features of the Java platform.
The C struct wrapper.
- Since:
- 0.1.0
- Author:
- squid233
-
Field Summary
Fields inherited from class overrungl.Pointer
address, allocator, managedSegment
-
Constructor Summary
ConstructorDescriptionStruct
(MemorySegmentPREVIEW address, SegmentAllocatorPREVIEW allocator) Creates a struct instance.Struct
(MemorySegmentPREVIEW address, SegmentAllocatorPREVIEW allocator, MemoryLayoutPREVIEW layout) Creates a struct instance with the given memory layout. -
Method Summary
-
Field Details
-
layout
The memory layout of this struct.The memory layout can be modified in subclasses to load lazily.
-
-
Constructor Details
-
Struct
public Struct(MemorySegmentPREVIEW address, SegmentAllocatorPREVIEW allocator, MemoryLayoutPREVIEW layout) Creates a struct instance with the given memory layout.- Parameters:
address
- the address.allocator
- the allocator of this address.layout
- the memory layout of this struct.
-
Struct
Creates a struct instance.- Parameters:
address
- the address.allocator
- the allocator of this address.
-
-
Method Details
-
segment
Gets as a native segment.- Returns:
- the memory segment.
- See Also:
-
layout
Returns the layout of this struct.- Returns:
- the layout of this struct
-
sizeof
public long sizeof()Returns the elements size of this struct in bytes.- Returns:
- the elements size of this struct in bytes
-
Struct
when preview features are enabled.