Module weaktable

Types

WeakValueTable*[K, V] = WeakRefable[WeakValueTableObj[K, V]]
  Source Edit

Procs

proc newWeakValueTable*[K, V](self: var WeakValueTable[K, V])
Creates a table, which doesn't prevent its value from being destructed. (when this happens, the key-value pair is removed from table).   Source Edit
proc newWeakValueTable*[K, V](): WeakValueTable[K, V]
  Source Edit
proc `$`*[K, V](self: WeakValueTable[K, V]): string
  Source Edit
proc contains*[K, V](self: WeakValueTable[K, V]; k: K): bool
  Source Edit
proc `[]`*[K, V](self: WeakValueTable[K, V]; k: K): WeakRefable[V]
  Source Edit
proc len*[K, V](self: WeakValueTable[K, V]): int
  Source Edit
proc del*[K, V](self: WeakValueTable[K, V]; k: K)
  Source Edit
proc addKey*[K, V](self: WeakValueTable[K, V]; k: K; v: ref V;
                 freeCallback: proc (v: ref V) {.
cdecl
.} = nil): WeakRefable[V]
Add a new item at key k to the table. Invoke freeCallback when there are no more references to this item.   Source Edit