mbind_bracket.nim 313 B

123456789101112131415161718
  1. import tables
  2. type
  3. UUIDObject* = ref object
  4. uuid: string
  5. Registry*[T] = ref object
  6. objects: Table[string, T]
  7. proc newRegistry*[T](): Registry[T] =
  8. result = Registry[T]()
  9. result.objects = initTable[string, T](128)
  10. proc register*[T](self: Registry[T], obj: T) =
  11. self.objects[obj.uuid] = obj