Composer

class Composer<N>(applier: Applier<N>, parentReference: CompositionReference)

Implementation of a composer for mutable tree.

Constructors

Composer
Link copied to clipboard
common
fun <N> Composer(applier: Applier<N>, parentReference: CompositionReference)

Functions

applyChanges
Link copied to clipboard
common
fun applyChanges()
Apply the changes to the tree that were collected during the last composition.
cache
Link copied to clipboard
common
inline fun <T> cache(invalid: Boolean, block: () -> T): T
Cache a value in the composition.
changed
Link copied to clipboard
common
fun changed(value: Any?): Boolean
Determine if the current slot table value is equal to the given value, if true, the value is scheduled to be skipped during applyChanges and changes return false; otherwise applyChanges will update the slot table to value.
fun changed(value: Boolean): Boolean
fun changed(value: Byte): Boolean
fun changed(value: Char): Boolean
fun changed(value: Double): Boolean
fun changed(value: Float): Boolean
fun changed(value: Int): Boolean
fun changed(value: Long): Boolean
fun changed(value: Short): Boolean
collectKeySourceInformation
Link copied to clipboard
common
fun collectKeySourceInformation()
Start collecting key source information.
collectParameterInformation
Link copied to clipboard
common
fun collectParameterInformation()
Start collecting parameter information.
composeInitial
Link copied to clipboard
common
fun composeInitial(block: () -> Unit)
Synchronously compose the initial composition of block.
endDefaults
Link copied to clipboard
common
fun endDefaults()
Warning: This is expected to be executed by the compiler only and should not be called directly from source code.
endMovableGroup
Link copied to clipboard
common
fun endMovableGroup()
Indicates the end of a "Movable Group" at the current execution position.
endReplaceableGroup
Link copied to clipboard
common
fun endReplaceableGroup()
Indicates the end of a "Replaceable Group" at the current execution position.
endRestartGroup
Link copied to clipboard
common
fun endRestartGroup(): ScopeUpdateScope?
End a restart group.
equals
Link copied to clipboard
common
open operator fun equals(other: Any?): Boolean
hashCode
Link copied to clipboard
common
open fun hashCode(): Int
joinKey
Link copied to clipboard
common
fun joinKey(left: Any?, right: Any?): Any
Create a composed key that can be used in calls to startGroup or startNode.
recompose
Link copied to clipboard
common
fun recompose(): Boolean
Synchronously recompose all invalidated groups.
recordModificationsOf
Link copied to clipboard
common
fun recordModificationsOf(values: Set<Any>)
Record that the objects in values have been modified.
recordReadOf
Link copied to clipboard
common
fun recordReadOf(value: Any)
Record that value was read from.
recordWriteOf
Link copied to clipboard
common
fun recordWriteOf(value: Any)
Record that value was written to during composition.
skipCurrentGroup
Link copied to clipboard
common
fun skipCurrentGroup()
Skip a group.
skipToGroupEnd
Link copied to clipboard
common
fun skipToGroupEnd()
Skip to the end of the group opened by startGroup.
startDefaults
Link copied to clipboard
common
fun startDefaults()
Warning: This is expected to be executed by the compiler only and should not be called directly from source code.
startMovableGroup
Link copied to clipboard
common
fun startMovableGroup(key: Int, dataKey: Any?)
Inserts a "Movable Group" starting marker in the slot table at the current execution position.
fun startMovableGroup(key: Int, dataKey: Any?, sourceInformation: String?)
startReplaceableGroup
Link copied to clipboard
common
fun startReplaceableGroup(key: Int)
Inserts a "Replaceable Group" starting marker in the slot table at the current execution position.
fun startReplaceableGroup(key: Int, sourceInformation: String?)
startRestartGroup
Link copied to clipboard
common
fun startRestartGroup(key: Int)
Start a restart group.
fun startRestartGroup(key: Int, sourceInformation: String?)
toString
Link copied to clipboard
common
open fun toString(): String
verifyConsistent
Link copied to clipboard
common
fun verifyConsistent()
Throw a diagnostic exception if the internal tracking tables are inconsistent.

Properties

applyCoroutineContext
Link copied to clipboard
common
val applyCoroutineContext: CoroutineContext
compositionData
Link copied to clipboard
common
val compositionData: CompositionData
currentCompoundKeyHash
Link copied to clipboard
common
var currentCompoundKeyHash: Int = 0
Returns the hash of the compound key calculated as a combination of the keys of all the currently started groups via startGroup.
defaultsInvalid
Link copied to clipboard
common
val defaultsInvalid: Boolean
skipping
Link copied to clipboard
common
val skipping: Boolean
True if the composition should be checking if the composable functions can be skipped.