Package 

Class UniquePointer

  • All Implemented Interfaces:
    app.rive.core.CheckableAutoCloseable , java.lang.AutoCloseable

    
    public final class UniquePointer
     implements CheckableAutoCloseable
                        

    A unique pointer to a native C++ object.

    Assumes ownership of the native resource. Use close to dispose the native pointer and release its resources. This will invoke onDispose. Uses CloseOnce to ensure that disposal only happens once.

    • Method Summary

      Modifier and Type Method Description
      final Long getPointer()
      final String getLabel()
      Boolean getClosed() Whether this resource has been closed.
      • Methods inherited from class app.rive.core.UniquePointer

        close
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • UniquePointer

        UniquePointer(Long cppPointer, String label, Function1<Long, Unit> onDispose)
        Parameters:
        cppPointer - The native pointer address.
        label - A label for the object pointed to, used for logging purposes, e.g.
        onDispose - A callback invoked when the pointer is closed to clean up the native resource.