-
- All Implemented Interfaces:
-
app.rive.runtime.kotlin.core.RefCount
public abstract class ViewModelProperty<T extends Object> extends NativeObject
A property of type T of a ViewModelInstance. Use value to mutate the property. use valueFlow to subscribe to changes on the value.
-
-
Field Summary
Fields Modifier and Type Field Description private final Stringnameprivate Tvalueprivate final <ERROR CLASS>valueFlowprivate final BooleanhasCppObjectprivate AtomicIntegerrefsprivate LongcppPointerprivate final List<RefCount>dependenciesprivate final IntegerrefCount
-
Constructor Summary
Constructors Constructor Description ViewModelProperty(Long unsafeCppPointer, ReentrantLock fileLock)
-
Method Summary
Modifier and Type Method Description final StringgetName()final TgetValue()final UnitsetValue(T value)final <ERROR CLASS>getValueFlow()A flow of the property's value. final BooleangetHasCppObject()final AtomicIntegergetRefs()final UnitsetRefs(AtomicInteger refs)final LonggetCppPointer()final UnitsetCppPointer(Long cppPointer)final List<RefCount>getDependencies()IntegergetRefCount()final StringcppName(Long cppPointer)final BooleancppHasChanged(Long cppPointer)Integerrelease()Release this property while holding the current file lock. -
-
Constructor Detail
-
ViewModelProperty
ViewModelProperty(Long unsafeCppPointer, ReentrantLock fileLock)
- Parameters:
unsafeCppPointer- Pointer to the C++ counterpart.fileLock- Lock shared by the File and native graph this property mutates.
-
-
Method Detail
-
getValueFlow
final <ERROR CLASS> getValueFlow()
A flow of the property's value. Use for observing changes.
-
getHasCppObject
final Boolean getHasCppObject()
-
getRefs
final AtomicInteger getRefs()
-
setRefs
final Unit setRefs(AtomicInteger refs)
-
getCppPointer
final Long getCppPointer()
-
setCppPointer
final Unit setCppPointer(Long cppPointer)
-
getDependencies
final List<RefCount> getDependencies()
-
getRefCount
Integer getRefCount()
-
cppHasChanged
@VisibleForTesting(otherwise = 2) final Boolean cppHasChanged(Long cppPointer)
-
release
Integer release()
Release this property while holding the current file lock.
NativeObject.release is synchronized on this object and subclasses may enter fileLock during cppDelete. Taking the file lock first keeps disposal ordered as file lock -> object monitor -> native delete.
-
-
-
-