three-nebula API
    Preparing search index...

    Class Pool

    An object pool implementation. Used for pooling objects to avoid unnecessary garbage collection.

    Index
    cID: number
    list: Record<string, Poolable[]>
    type: string
    • Gets the pool mapped to the UID.

      Parameters

      • Optionaluid: string

      Returns Poolable[]

    • Determines if the object is able to be cloned or not.

      Parameters

      • object: unknown

      Returns boolean

    • Determines if a new object is able to be created.

      Parameters

      • object: unknown

      Returns boolean

    • Determines if the object is able to be instantiated or not.

      Parameters

      • object: unknown

      Returns boolean

    • Attempts to create a new object either by creating a new instance or calling its clone method.

      Parameters

      • functionOrObject: unknown
      • ...constructorArgs: unknown[]

      Returns unknown

    • Pushes an object into the pool.

      Parameters

      • obj: unknown

      Returns number

    • Gets an object either by creating a new one or retrieving it from the pool. The pooled object is either constructed from obj (when it is a class) or a clone of obj; either way the result is a T, so callers no longer cast.

      Type Parameters

      • T

      Parameters

      • obj: T | (new (...args: never[]) => T)
      • ...args: unknown[]

      Returns T

    • Gets a count of all objects in the pool.

      Returns number