Pool

open class Pool<T : Any>(reset: (T) -> Unit = {}, preallocate: Int = 0, gen: (Int) -> T)

Structure containing a set of reusable objects.

The method alloc retrieves from the pool or allocates a new object, while the free method pushes back one element to the pool and resets it to reuse it.

Inheritors

Constructors

Link copied to clipboard
constructor(preallocate: Int = 0, gen: (Int) -> T)
constructor(reset: (T) -> Unit = {}, preallocate: Int = 0, gen: (Int) -> T)

Types

Link copied to clipboard
object Companion
Link copied to clipboard
interface Poolable

Properties

Link copied to clipboard
Link copied to clipboard
Link copied to clipboard

Functions

Link copied to clipboard
open fun alloc(): T
inline fun <R> alloc(callback: (T) -> R): R
Link copied to clipboard
inline fun <R> alloc2(callback: (T, T) -> R): R
Link copied to clipboard
inline fun <R> alloc3(callback: (T, T, T) -> R): R
Link copied to clipboard
inline fun <R> allocMultiple(count: Int, temp: FastArrayList<T> = FastArrayList(), callback: (FastArrayList<T>) -> R): R
Link copied to clipboard
inline fun <R> allocThis(callback: T.() -> R): R
Link copied to clipboard
open fun clear()
Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open fun free(element: T)
fun free(vararg elements: T)
fun free(elements: Iterable<T>)
fun free(elements: List<T>)
Link copied to clipboard
fun freeNotNull(element: T?)
Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
inline operator fun <R> invoke(callback: (T) -> R): R