Interface Struct<T extends Struct<T>>
- Type Parameters:
T
- the type of the actual structure interface
public interface Struct<T extends Struct<T>>
The representation of a C structure.
Returning a Struct
from a downcall method or pass a Struct
by value requires a
registration to tell
ReturnValueTransformer
how to create an instance of the Struct
and DescriptorTransformer
the layout of the structure.
- Since:
- 0.1.0
- Author:
- squid233
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionlong
Returns the element count of this struct buffer.static long
estimateCount
(MemorySegment segment, StructLayout layout) Estimates the struct count of the given segment.layout()
Returns the layout of this struct.segment()
Returns the segment of this struct.default SequenceLayout
Returns the sequence layout of this struct buffer.slice
(long index) Makes a slice of this structure with the given index.slice
(long index, long count) Makes a slice of this structure starts at the given index.
-
Method Details
-
estimateCount
Estimates the struct count of the given segment.- Parameters:
segment
- the segmentlayout
- the struct layout- Returns:
- the count
-
slice
Makes a slice of this structure starts at the given index.- Parameters:
index
- the start indexcount
- the count- Returns:
- the slice of this structure
-
slice
Makes a slice of this structure with the given index.- Parameters:
index
- the index- Returns:
- the slice of this structure
-
segment
-
layout
-
sequenceLayout
Returns the sequence layout of this struct buffer.- Returns:
- the sequence layout of this struct buffer
-
elementCount
long elementCount()Returns the element count of this struct buffer.- Returns:
- the element count of this struct buffer
-