Interface TypeValueCopyFunc

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

Functional interface declaration of the TypeValueCopyFunc callback.

See Also:
  • Method Details

    • run

      void run(Value srcValue, Value destValue)

      Copies the content of a GValue into another.

      The destValue is a GValue with zero-filled data section and srcValue is a properly initialized GValue of same type, or derived type.

      The purpose of this function is to copy the contents of srcValue into destValue in a way, that even after srcValue has been freed, the contents of destValue remain valid. String type example:

      dest_value->data[0].v_pointer = g_strdup (src_value->data[0].v_pointer);
      
      Parameters:
      srcValue - the value to copy
      destValue - the location of the copy
      Since:
      2.78
    • upcall

      default void upcall(MemorySegment srcValue, MemorySegment destValue)
      The upcall method is called from native code. The parameters are marshaled and run(Value, Value) 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