Package org.gnome.gobject
Interface TypeClassCacheFunc
- 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 TypeClassCacheFunc
extends FunctionPointer
Functional interface declaration of the
TypeClassCacheFunc
callback.
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionboolean
run
(@Nullable MemorySegment cacheData, TypeClass gClass) A callback function which is called when the reference count of a class drops to zero.default MemorySegment
toCallback
(Arena arena) Creates a native function pointer to theupcall(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment)
method.default int
upcall
(MemorySegment cacheData, MemorySegment gClass) Theupcall
method is called from native code.
-
Method Details
-
run
A callback function which is called when the reference count of a class drops to zero.It may use g_type_class_ref() to prevent the class from being freed. You should not call g_type_class_unref() from a
GTypeClassCacheFunc
function to prevent infinite recursion, use g_type_class_unref_uncached() instead.The functions have to check the class id passed in to figure whether they actually want to cache the class of this type, since all classes are routed through the same
GTypeClassCacheFunc
chain. -
upcall
Theupcall
method is called from native code. The parameters are marshaled andrun(java.lang.foreign.MemorySegment, org.gnome.gobject.TypeClass)
is executed. -
toCallback
Creates a native function pointer to theupcall(java.lang.foreign.MemorySegment, java.lang.foreign.MemorySegment)
method.- Specified by:
toCallback
in interfaceFunctionPointer
- Parameters:
arena
- the function pointer will be allocated in this arena- Returns:
- the native function pointer
-