Unique Pointer
data class UniquePointer(cppPointer: Long, val label: String, onDispose: (Long) -> Unit) : 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.
Parameters
cpp Pointer
The native pointer address.
label
A label for the object pointed to, used for logging purposes, e.g. "Artboard".
on Dispose
A callback invoked when the pointer is closed to clean up the native resource.