Package org.gnome.gobject
Interface TypeValueLCopyFunc
- 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("io.github.jwharm.JavaGI")
public interface TypeValueLCopyFunc
extends FunctionPointer
Functional interface declaration of the
TypeValueLCopyFunc callback.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionrun(Value value, @Nullable TypeCValue @Nullable [] collectValues, int collectFlags) This function is responsible for storing thevaluecontents into arguments passed through a variadic argument list which got collected intocollect_valuesaccording tolcopy_format.default MemorySegmenttoCallback(Arena arena) Creates a native function pointer to theupcall(java.lang.foreign.MemorySegment, int, java.lang.foreign.MemorySegment, int)method.default MemorySegmentupcall(MemorySegment value, int nCollectValues, MemorySegment collectValues, int collectFlags) Theupcallmethod is called from native code.
-
Method Details
-
run
This function is responsible for storing thevaluecontents into arguments passed through a variadic argument list which got collected intocollect_valuesaccording tolcopy_format.The
n_collect_valuesargument equals the string length oflcopy_format, andcollect_flagsmay containG_VALUE_NOCOPY_CONTENTS.In contrast to
GTypeValueCollectFunc, this function is obliged to always properly supportG_VALUE_NOCOPY_CONTENTS.Similar to
GTypeValueCollectFuncthe function may prematurely abort by returning a newly allocated string describing an error condition. To complete the string example:gchar **string_p = collect_values[0].v_pointer; g_return_val_if_fail (string_p != NULL, g_strdup ("string location passed as NULL")); if (collect_flags & G_VALUE_NOCOPY_CONTENTS) *string_p = value->data[0].v_pointer; else *string_p = g_strdup (value->data[0].v_pointer);And an illustrative version of this function for reference-counted types:
GObject **object_p = collect_values[0].v_pointer; g_return_val_if_fail (object_p != NULL, g_strdup ("object location passed as NULL")); if (value->data[0].v_pointer == NULL) *object_p = NULL; else if (collect_flags & G_VALUE_NOCOPY_CONTENTS) // always honour *object_p = value->data[0].v_pointer; else *object_p = g_object_ref (value->data[0].v_pointer); return NULL;- Since:
- 2.78
-
upcall
default MemorySegment upcall(MemorySegment value, int nCollectValues, MemorySegment collectValues, int collectFlags) Theupcallmethod is called from native code. The parameters are marshaled andrun(org.gnome.gobject.Value, org.gnome.gobject.TypeCValue[], int)is executed. -
toCallback
Creates a native function pointer to theupcall(java.lang.foreign.MemorySegment, int, java.lang.foreign.MemorySegment, int)method.- Specified by:
toCallbackin interfaceFunctionPointer- Parameters:
arena- the arena in which the function pointer is allocated- Returns:
- the native function pointer
-