keyset.pxd 1.1 KB

1234567891011121314151617181920212223242526272829303132
  1. from lakesuperior.model.base cimport (
  2. Key, Key, DoubleKey, TripleKey, Buffer
  3. )
  4. ctypedef bint (*key_cmp_fn_t)(
  5. const TripleKey* spok, const Key* k1, const Key* k2
  6. )
  7. cdef class Keyset:
  8. cdef:
  9. TripleKey* data
  10. size_t ct
  11. size_t _cur # Index cursor used to look up values.
  12. size_t _free_i # Index of next free slot.
  13. float expand_ratio # By how much storage is automatically expanded when
  14. # full. 1 means the size doubles, 0.5 a 50%
  15. # increase. 0 means that storage won't be
  16. # automatically expanded and adding above capacity
  17. # will raise an error.
  18. void seek(self, size_t idx=*)
  19. size_t size(self)
  20. size_t tell(self)
  21. bint get_next(self, TripleKey* item)
  22. void add(self, const TripleKey* val) except *
  23. void remove(self, const TripleKey* val) except *
  24. bint contains(self, const TripleKey* val)
  25. Keyset copy(self)
  26. void resize(self, size_t size=*) except *
  27. Keyset lookup(
  28. self, const Key* sk, const Key* pk, const Key* ok
  29. )