map.pxd 2.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768
  1. from .utility cimport pair
  2. cdef extern from "<map>" namespace "std" nogil:
  3. cdef cppclass map[T, U, COMPARE=*, ALLOCATOR=*]:
  4. ctypedef T key_type
  5. ctypedef U mapped_type
  6. ctypedef pair[const T, U] value_type
  7. ctypedef COMPARE key_compare
  8. ctypedef ALLOCATOR allocator_type
  9. cppclass iterator:
  10. pair[T, U]& operator*()
  11. iterator operator++()
  12. iterator operator--()
  13. bint operator==(iterator)
  14. bint operator!=(iterator)
  15. cppclass reverse_iterator:
  16. pair[T, U]& operator*()
  17. iterator operator++()
  18. iterator operator--()
  19. bint operator==(reverse_iterator)
  20. bint operator!=(reverse_iterator)
  21. cppclass const_iterator(iterator):
  22. pass
  23. cppclass const_reverse_iterator(reverse_iterator):
  24. pass
  25. map() except +
  26. map(map&) except +
  27. #map(key_compare&)
  28. U& operator[](T&)
  29. #map& operator=(map&)
  30. bint operator==(map&, map&)
  31. bint operator!=(map&, map&)
  32. bint operator<(map&, map&)
  33. bint operator>(map&, map&)
  34. bint operator<=(map&, map&)
  35. bint operator>=(map&, map&)
  36. U& at(const T&) except +
  37. const U& const_at "at"(const T&) except +
  38. iterator begin()
  39. const_iterator const_begin "begin" ()
  40. void clear()
  41. size_t count(const T&)
  42. bint empty()
  43. iterator end()
  44. const_iterator const_end "end" ()
  45. pair[iterator, iterator] equal_range(const T&)
  46. #pair[const_iterator, const_iterator] equal_range(key_type&)
  47. void erase(iterator)
  48. void erase(iterator, iterator)
  49. size_t erase(const T&)
  50. iterator find(const T&)
  51. const_iterator const_find "find" (const T&)
  52. pair[iterator, bint] insert(pair[T, U]) except + # XXX pair[T,U]&
  53. iterator insert(iterator, pair[T, U]) except + # XXX pair[T,U]&
  54. #void insert(input_iterator, input_iterator)
  55. #key_compare key_comp()
  56. iterator lower_bound(const T&)
  57. const_iterator const_lower_bound "lower_bound"(const T&)
  58. size_t max_size()
  59. reverse_iterator rbegin()
  60. const_reverse_iterator const_rbegin "rbegin"()
  61. reverse_iterator rend()
  62. const_reverse_iterator const_rend "rend"()
  63. size_t size()
  64. void swap(map&)
  65. iterator upper_bound(const T&)
  66. const_iterator const_upper_bound "upper_bound"(const T&)
  67. #value_compare value_comp()