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 UnmarshalProcessor 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 Type
    Method
    Description
    long
    Returns the element count of this struct buffer.
    static long
    Estimates the struct count of the given segment.
    Returns the layout of this struct.
    Returns the segment of this struct.
    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

      static long estimateCount(MemorySegment segment, StructLayout layout)
      Estimates the struct count of the given segment.
      Parameters:
      segment - the segment
      layout - the struct layout
      Returns:
      the count
    • slice

      T slice(long index, long count)
      Makes a slice of this structure starts at the given index.
      Parameters:
      index - the start index
      count - the count
      Returns:
      the slice of this structure
    • slice

      T slice(long index)
      Makes a slice of this structure with the given index.
      Parameters:
      index - the index
      Returns:
      the slice of this structure
    • segment

      MemorySegment segment()
      Returns the segment of this struct.
      Returns:
      the segment of this struct
    • layout

      StructLayout layout()
      Returns the layout of this struct.
      Returns:
      the layout of this struct
    • sequenceLayout

      default SequenceLayout 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