Interface NodeForeachFunc

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 NodeForeachFunc extends FunctionPointer

Functional interface declaration of the NodeForeachFunc callback.

See Also:
  • Method Details

    • run

      void run(Node node, @Nullable MemorySegment data)
      Specifies the type of function passed to g_node_children_foreach(). The function is called with each child node, together with the user data passed to g_node_children_foreach().
      Parameters:
      node - a GNode.
      data - user data passed to g_node_children_foreach().
    • upcall

      default void upcall(MemorySegment node, MemorySegment data)
      The upcall method is called from native code. The parameters are marshaled and run(Node, MemorySegment) is executed.
    • toCallback

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