Package jnr.ffi

Class Struct.StructRef<T extends Struct>

  • Type Parameters:
    T - - Struct type
    Enclosing class:
    Struct

    public class Struct.StructRef<T extends Struct>
    extends Struct.PointerField
    Represents a reference to a Struct or and array of Structs
    • Constructor Detail

      • StructRef

        public StructRef​(Class<T> structType)
      • StructRef

        public StructRef​(Class<T> structType,
                         int initialStructCount)
        Parameters:
        structType - Struct type
        initialStructCount - the number of struct instances. Use this to allocate memory without setting value.
      • StructRef

        public StructRef​(Struct.Offset offset,
                         Class<T> structType,
                         int initialStructCount)
        Parameters:
        offset - offset of the field
        structType - Struct type
        initialStructCount - the number of struct instances. Use this to allocate memory without setting value.
    • Method Detail

      • set

        public final void set​(T struct)
      • set

        public final void set​(T[] structs)
      • get

        public final T get()
        Returns:
        struct from memory
      • get

        public final T[] get​(int length)
        Returns:
        struct from memory