-
- All Implemented Interfaces:
-
app.rive.core.RefCounted
public final class RCPointer implements RefCounted
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description public classRCPointer.Companion
-
Method Summary
Modifier and Type Method Description IntegergetRefCount()BooleangetIsDisposed()final LonggetPointer()final StringgetLabel()Unitacquire(String source)Acquire a reference. Unitrelease(String source, String reason)Releases a reference to this pointer. -
-
Constructor Detail
-
RCPointer
RCPointer(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 reference count reaches zero to clean up the native resource.
-
-
Method Detail
-
getRefCount
Integer getRefCount()
-
getIsDisposed
Boolean getIsDisposed()
-
getPointer
final Long getPointer()
-
acquire
Unit acquire(String source)
Acquire a reference. Must be balanced with a call to release.
- Parameters:
source- A string indicating the source of the acquisition, for logging purposes, e.g.
-
release
Unit release(String source, String reason)
Releases a reference to this pointer. When the reference count reaches zero, the onDispose callback is invoked to clean up the native resource.
- Parameters:
source- A string indicating the source of the acquisition, for logging purposes, e.g.reason- An optional string indicating the reason for the release, for logging purposes.
-
-
-
-