Interface MemoryMapFunction

All Superinterfaces:
FunctionPointer
Functional Interface:
This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.

@FunctionalInterface @Generated("org.javagi.JavaGI") public interface MemoryMapFunction extends FunctionPointer

Functional interface declaration of the MemoryMapFunction callback.

See Also:
  • Method Summary

    Modifier and Type
    Method
    Description
    run(Memory mem, long maxsize, int flags)
    Get the memory of mem that can be accessed according to the mode specified in flags. The function should return a pointer that contains at least maxsize bytes.
    Creates a native function pointer to the upcall(MemorySegment, long, int) method.
    upcall(MemorySegment mem, long maxsize, int flags)
    The upcall method is called from native code.
  • Method Details

    • run

      MemorySegment run(Memory mem, long maxsize, int flags)
      Get the memory of mem that can be accessed according to the mode specified in flags. The function should return a pointer that contains at least maxsize bytes.
      Parameters:
      mem - a GstMemory
      maxsize - size to map
      flags - access mode for the memory
      Returns:
      a pointer to memory of which at least maxsize bytes can be accessed according to the access pattern in flags.
    • upcall

      default MemorySegment upcall(MemorySegment mem, long maxsize, int flags)
      The upcall method is called from native code. The parameters are marshaled and run(Memory, long, int) is executed.
    • toCallback

      default MemorySegment toCallback(Arena arena)
      Creates a native function pointer to the upcall(MemorySegment, long, int) method.
      Specified by:
      toCallback in interface FunctionPointer
      Parameters:
      arena - the arena in which the function pointer is allocated
      Returns:
      the native function pointer