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

InternRoot

class InternRoot<TBase : Any> : IInternRoot<TBase>

Constructors

<init>

InternRoot(serializer: ISerializer<TBase> = Polymorphic())

Properties

async

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.

isBound

val isBound: Boolean

location

var location: <ERROR CLASS>

parent

var parent: IRdDynamic?

protocol

val protocol: IProtocol

rdid

var rdid: RdId

serializationContext

val serializationContext: SerializationCtx

serializer

val serializer: ISerializer<TBase>

wireScheduler

val wireScheduler: <ERROR CLASS>

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

Functions

bind

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

Inserts the node into the object graph under the given parent and assigns the specified name to it. The node will be removed from the graph when the specified lf lifetime is terminated.

deepClone

fun deepClone(): IRdBindable

Creates a clone of this IRdBindable not bound to any protocol

identify

fun identify(identities: IIdentities, id: RdId): Unit

Assigns IDs to this node and its child nodes in the graph.

intern

fun intern(value: TBase): InternId

Interns a value and returns an ID for it. May return invalid ID if the value can't be interned due to multithreaded conflicts

onWireReceived

fun onWireReceived(buffer: AbstractBuffer): Unit

Callback that wire triggers when it receives messaged

remove

fun remove(value: TBase): Unit

Removes interned value. Any future attempts to un-intern IDs previously associated with this value will fail. Not thread-safe. It's up to user to ensure that the value being removed is not being used in messages written on background threads.

tryGetInterned

fun tryGetInterned(value: TBase): InternId

Returns an ID for a value. Returns invalid ID if the value was not interned

tryUnIntern

fun <T : TBase> tryUnIntern(id: InternId): T?

Gets a valie from interned ID, returns null if no value matches the given ID

unIntern

fun <T : TBase> unIntern(id: InternId): T

Gets a value from interned ID. Throws an exception if no value matches the given ID

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?