Package jnr.ffi

Class StructLayout.Pointer

Enclosing class:
StructLayout

public class StructLayout.Pointer extends StructLayout.NumberField
Represents a native memory address.
  • Constructor Details

    • Pointer

      public Pointer()
      Creates a new Address field.
    • Pointer

      public Pointer(StructLayout.Offset offset)
  • Method Details

    • get

      public final Pointer get(Pointer ptr)
      Gets the Pointer value from the native memory.
      Parameters:
      ptr - The pointer to the field.
      Returns:
      a Pointer.
    • size

      public final int size()
      Gets the size of a Pointer in bits
      Returns:
      the size of the Pointer
    • set

      public final void set(Pointer ptr, Pointer value)
      Sets a Pointer value in the native memory.
      Parameters:
      ptr - The pointer to the write location.
      value - The value to set.
    • set

      public void set(Pointer ptr, Number value)
      Description copied from class: StructLayout.NumberField
      Sets the field to a new value.
      Specified by:
      set in class StructLayout.NumberField
      Parameters:
      ptr - The pointer to the field.
      value - The new value.
    • intValue

      public final int intValue(Pointer ptr)
      Returns an integer representation of this Pointer.
      Specified by:
      intValue in class StructLayout.NumberField
      Parameters:
      ptr - The pointer to the field.
      Returns:
      an integer value for this Pointer.
    • longValue

      public final long longValue(Pointer ptr)
      Returns an long representation of this Pointer.
      Overrides:
      longValue in class StructLayout.NumberField
      Parameters:
      ptr - The pointer to the field.
      Returns:
      an long value for this Pointer.
    • toString

      public final String toString(Pointer ptr)
      Returns a string representation of this Pointer.
      Overrides:
      toString in class StructLayout.NumberField
      Parameters:
      ptr - The pointer to the field.
      Returns:
      a string representation of this Pointer.