ModifierNodeType

class ModifierNodeType<E : ModifierElement, N : ModifierNode>(elementClass: KClass<E>, nodeClass: KClass<out N>, validateLocal: (E) -> Unit, createNode: (E) -> N, updateNode: (E, E, N) -> DirtyMask)(source)

Stable referential token and typed bridge for one modifier description and node pair.

An application retains one instance as a singleton for each logical modifier kind. Two separately constructed tokens remain incompatible even when their class tokens and hooks are otherwise equal. The complete incoming tree is validated before the runtime invokes creation or update hooks.

Parameters

elementClass

the runtime class used to validate and cast descriptions at the erased boundary.

nodeClass

the runtime class used to validate and cast retained nodes at the erased boundary.

validateLocal

checks properties owned by one description before retained mutation.

createNode

creates a fresh, never-owned modifier node for a validated description.

updateNode

applies previous and current descriptions on the owner thread and reports affected phases.

Type Parameters

E

the immutable modifier description type.

N

the retained modifier node type.

Constructors

Link copied to clipboard
constructor(elementClass: KClass<E>, nodeClass: KClass<out N>, validateLocal: (E) -> Unit, createNode: (E) -> N, updateNode: (E, E, N) -> DirtyMask)

Functions

Link copied to clipboard

Creates one detached modifier node through the typed creation hook.

Link copied to clipboard

Updates one retained modifier node through its typed diff hook.

Link copied to clipboard

Validates one modifier description through its typed local hook.