rd-framework / com.jetbrains.rd.framework.impl / RdPerContextMap

RdPerContextMap

class RdPerContextMap<K : Any, V : RdBindableBase> : RdReactiveBase, IPerContextMap<K, V>

Constructors

<init>

RdPerContextMap(context: RdContext<K>, valueFactory: (Boolean) -> V)

Properties

changing

val changing: <ERROR CLASS>

context

val context: RdContext<K>

The context that is used by this map. Must be heavy.

optimizeNested

var optimizeNested: Boolean

valueFactory

val valueFactory: (Boolean) -> V

Inherited Properties

async

open var async: Boolean

If set to true, local changes to this object can be performed on any thread. Otherwise, local changes can be performed only on the UI thread.

defaultScheduler

val defaultScheduler: <ERROR CLASS>

isLocalChange

var isLocalChange: Boolean

master

var master: Boolean

serializers

val serializers: ISerializers

wire

val wire: IWire

wireScheduler

open val wireScheduler: <ERROR CLASS>

Scheduler on which wire invokes callback onWireReceived. Default is the same as protocol's one.

Functions

deepClone

fun deepClone(): IRdBindable

get

operator fun get(key: K): V?

Gets the value associated with specified context value, or null if none is associated When this map is not bound, this will automatically create a new mapping instead of returning null

getForCurrentContext

fun getForCurrentContext(): V

Gets the value associated with current context value, equivalent to get(context.value) If the context doesn't have a value set, or contexts's protocol value set does not contain the current context value, this will throw an exception

init

fun init(lifetime: <ERROR CLASS>): Unit

onWireReceived

fun onWireReceived(buffer: AbstractBuffer): Unit

Callback that wire triggers when it receives messaged

Inherited Functions

assertBound

fun assertBound(): Unit

assertThreading

fun assertThreading(): Unit

Companion Object Functions

read

fun <K : Any, V : RdBindableBase> read(key: RdContext<K>, buffer: AbstractBuffer, valueFactory: (Boolean) -> V): RdPerContextMap<K, V>

write

fun write(buffer: AbstractBuffer, map: RdPerContextMap<*, *>): Unit

Extension Functions

bind

fun <T : IRdBindable?> T.bind(lf: <ERROR CLASS>, parent: IRdDynamic, name: String): Unit?

deepClonePolymorphic

fun <T> T.deepClonePolymorphic(): T

identify

fun <T : IRdBindable?> T.identify(identities: IIdentities, ids: RdId): Unit?

static

fun <T : RdBindableBase> T.static(id: Int): T

withId

fun <T : RdBindableBase> T.withId(id: RdId): T

withIdFromName

fun <T : RdBindableBase> T.withIdFromName(name: String): T