IArea

An IArea is similar to an IBranch. They both provide transactional access to nodes, but the IBranch can only be used with an ITree. An IArea can be used with any INode. IArea is a higher level replacement for IBranch. The goal is to provide access to different independent models through one virtual model. It's like a unix filesystem with mount points. The model inside an area can also be an MPS model that is not a persistent data structure.

Inheritors

Functions

Link copied to clipboard
abstract fun addListener(l: IAreaListener)
Link copied to clipboard
abstract override fun canRead(): Boolean
Link copied to clipboard
abstract override fun canWrite(): Boolean
Link copied to clipboard
abstract fun collectAreas(): List<IArea>
Link copied to clipboard
abstract override fun <T> executeRead(body: () -> T): T
Link copied to clipboard
abstract override fun <T> executeWrite(body: () -> T): T
Link copied to clipboard

bigger numbers are locked first

Link copied to clipboard
Link copied to clipboard
abstract fun getRoot(): INode

The root of an area is not allowed to change

Link copied to clipboard
abstract fun removeListener(l: IAreaListener)
Link copied to clipboard
abstract fun resolveArea(ref: IAreaReference): IArea?
Link copied to clipboard
abstract fun resolveBranch(id: String): IBranch?
Link copied to clipboard
Link copied to clipboard
abstract override fun resolveNode(ref: INodeReference): INode?

The area should not delegate to INodeReference.resolveNode. If it can't handle the type of reference it should just return null.

Link copied to clipboard

This method allows resolveOriginalNode().getArea() != this

Link copied to clipboard
open fun <T> runWith(body: () -> T): T

All node references inside the body are resolved against this scope. Compared to runWithAlso, the existing scopes in the current context are not used, meaning they are replaced.

Link copied to clipboard
open fun <T> runWithAdditionalScope(body: () -> T): T

All node references inside the body are resolved against this scope and if that fails against any other scope in the current context.

Link copied to clipboard
open suspend fun <T> runWithAdditionalScopeInCoroutine(body: suspend () -> T): T

Does the same as runWithAlso, but with support for suspendable functions.

Link copied to clipboard
open suspend fun <T> runWithInCoroutine(body: suspend () -> T): T

Does the same as runWithOnly, but with support for suspendable functions.