Interface SignalEmissionHook

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

Functional interface declaration of the SignalEmissionHook callback.

See Also:
  • Method Details

    • run

      boolean run(SignalInvocationHint ihint, @Nullable Value @Nullable [] paramValues, @Nullable MemorySegment data)

      A simple function pointer to get invoked when the signal is emitted.

      Emission hooks allow you to tie a hook to the signal type, so that it will trap all emissions of that signal, from any object.

      You may not attach these to signals created with the SignalFlags.NO_HOOKS flag.

      Parameters:
      ihint - Signal invocation hint, see GSignalInvocationHint.
      paramValues - the instance on which the signal was emitted, followed by the parameters of the emission.
      data - user data associated with the hook.
      Returns:
      whether it wants to stay connected. If it returns false, the signal hook is disconnected (and destroyed).
    • upcall

      default int upcall(MemorySegment ihint, int nParamValues, MemorySegment paramValues, MemorySegment data)
      The upcall method is called from native code. The parameters are marshaled and run(SignalInvocationHint, Value[], MemorySegment) is executed.
    • toCallback

      default MemorySegment toCallback(Arena arena)
      Creates a native function pointer to the upcall(MemorySegment, int, 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