PointerRegister

A register for pointers.

Since

0.1.0

Parameters

T

The type of the value the pointers point to

See also

Constructors

Link copied to clipboard
constructor()

Types

Link copied to clipboard
object Companion

Functions

Link copied to clipboard

Create a mutable pointer inside the register

Link copied to clipboard
fun createPointer(value: T): Pointer<T>

Create a late init pointer inside the register

Link copied to clipboard
fun destroy()

Destroy the register

Link copied to clipboard

Destroy all contained pointers

Link copied to clipboard
operator fun get(index: Int): Pointer<T>

Get the pointer at the given index

Link copied to clipboard
fun getOrNull(index: Int): Pointer<T>?

Get the pointer at the given index or null if the pointer is not registered

Link copied to clipboard
fun indexOf(pointer: Pointer<Any?>): Int

Get the index of the given pointer

Link copied to clipboard
fun register(pointer: Pointer<T>): Int

Register a pointer to the register (and return the index of the pointer)

Link copied to clipboard
fun unregister(index: Int)

Unregister the pointer at the given index