1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193
|
from .utility cimport pair
cdef extern from "<unordered_map>" namespace "std" nogil:
cdef cppclass unordered_map[T, U, HASH=*, PRED=*, ALLOCATOR=*]:
ctypedef T key_type
ctypedef U mapped_type
ctypedef pair[const T, U] value_type
ctypedef ALLOCATOR allocator_type
# these should really be allocator_type.size_type and
# allocator_type.difference_type to be true to the C++ definition
# but cython doesn't support deferred access on template arguments
ctypedef size_t size_type
ctypedef ptrdiff_t difference_type
cppclass iterator
cppclass iterator:
iterator() except +
iterator(iterator&) except +
# correct would be value_type& but this does not work
# well with cython's code gen
pair[T, U]& operator*()
iterator operator++()
iterator operator--()
iterator operator++(int)
iterator operator--(int)
bint operator==(iterator)
bint operator==(const_iterator)
bint operator!=(iterator)
bint operator!=(const_iterator)
cppclass const_iterator:
const_iterator() except +
const_iterator(iterator&) except +
operator=(iterator&) except +
# correct would be const value_type& but this does not work
# well with cython's code gen
const pair[T, U]& operator*()
const_iterator operator++()
const_iterator operator--()
const_iterator operator++(int)
const_iterator operator--(int)
bint operator==(iterator)
bint operator==(const_iterator)
bint operator!=(iterator)
bint operator!=(const_iterator)
unordered_map() except +
unordered_map(unordered_map&) except +
#unordered_map(key_compare&)
U& operator[](const T&)
#unordered_map& operator=(unordered_map&)
bint operator==(unordered_map&, unordered_map&)
bint operator!=(unordered_map&, unordered_map&)
bint operator<(unordered_map&, unordered_map&)
bint operator>(unordered_map&, unordered_map&)
bint operator<=(unordered_map&, unordered_map&)
bint operator>=(unordered_map&, unordered_map&)
U& at(const T&) except +
const U& const_at "at"(const T&) except +
iterator begin()
const_iterator const_begin "begin"()
const_iterator cbegin()
void clear()
size_t count(const T&)
bint empty()
iterator end()
const_iterator const_end "end"()
const_iterator cend()
pair[iterator, iterator] equal_range(const T&)
pair[const_iterator, const_iterator] const_equal_range "equal_range"(const T&)
iterator erase(iterator)
iterator const_erase "erase"(const_iterator)
iterator erase(const_iterator, const_iterator)
size_t erase(const T&)
iterator find(const T&)
const_iterator const_find "find"(const T&)
pair[iterator, bint] insert(const pair[T, U]&) except +
iterator insert(const_iterator, const pair[T, U]&) except +
void insert[InputIt](InputIt, InputIt) except +
#key_compare key_comp()
iterator lower_bound(const T&)
const_iterator const_lower_bound "lower_bound"(const T&)
size_t max_size()
size_t size()
void swap(unordered_map&)
iterator upper_bound(const T&)
const_iterator const_upper_bound "upper_bound"(const T&)
#value_compare value_comp()
void max_load_factor(float)
float max_load_factor()
float load_factor()
void rehash(size_t)
void reserve(size_t)
size_t bucket_count()
size_t max_bucket_count()
size_t bucket_size(size_t)
size_t bucket(const T&)
# C++20
bint contains(const T&)
cdef cppclass unordered_multimap[T, U, HASH=*, PRED=*, ALLOCATOR=*]:
ctypedef T key_type
ctypedef U mapped_type
ctypedef pair[const T, U] value_type
ctypedef ALLOCATOR allocator_type
# these should really be allocator_type.size_type and
# allocator_type.difference_type to be true to the C++ definition
# but cython doesn't support deferred access on template arguments
ctypedef size_t size_type
ctypedef ptrdiff_t difference_type
cppclass const_iterator
cppclass iterator:
iterator() except +
iterator(iterator&) except +
# correct would be value_type& but this does not work
# well with cython's code gen
pair[T, U]& operator*()
iterator operator++()
iterator operator++(int)
bint operator==(iterator)
bint operator==(const_iterator)
bint operator!=(iterator)
bint operator!=(const_iterator)
cppclass const_iterator:
const_iterator() except +
const_iterator(iterator&) except +
operator=(iterator&) except +
# correct would be const value_type& but this does not work
# well with cython's code gen
const pair[T, U]& operator*()
const_iterator operator++()
const_iterator operator++(int)
bint operator==(iterator)
bint operator==(const_iterator)
bint operator!=(iterator)
bint operator!=(const_iterator)
unordered_multimap() except +
unordered_multimap(const unordered_multimap&) except +
#unordered_multimap(key_compare&)
#unordered_map& operator=(unordered_multimap&)
bint operator==(const unordered_multimap&, const unordered_multimap&)
bint operator!=(const unordered_multimap&, const unordered_multimap&)
bint operator<(const unordered_multimap&, const unordered_multimap&)
bint operator>(const unordered_multimap&, const unordered_multimap&)
bint operator<=(const unordered_multimap&, const unordered_multimap&)
bint operator>=(const unordered_multimap&, const unordered_multimap&)
iterator begin()
const_iterator const_begin "begin"()
const_iterator cbegin()
#local_iterator begin(size_t)
#const_local_iterator const_begin "begin"(size_t)
void clear()
size_t count(const T&)
bint empty()
iterator end()
const_iterator const_end "end"()
const_iterator cend()
#local_iterator end(size_t)
#const_local_iterator const_end "end"(size_t)
pair[iterator, iterator] equal_range(const T&)
pair[const_iterator, const_iterator] const_equal_range "equal_range"(const T&)
iterator erase(iterator)
iterator const_erase "erase"(const_iterator)
iterator erase(const_iterator, const_iterator)
size_t erase(const T&)
iterator find(const T&)
const_iterator const_find "find"(const T&)
iterator insert(const pair[T, U]&) except +
iterator insert(const_iterator, const pair[T, U]&) except +
void insert[InputIt](InputIt, InputIt) except +
#key_compare key_comp()
iterator lower_bound(const T&)
const_iterator const_lower_bound "lower_bound"(const T&)
size_t max_size()
size_t size()
void swap(unordered_multimap&)
iterator upper_bound(const T&)
const_iterator const_upper_bound "upper_bound"(const T&)
#value_compare value_comp()
void max_load_factor(float)
float max_load_factor()
float load_factor()
void rehash(size_t)
void reserve(size_t)
size_t bucket_count()
size_t max_bucket_count()
size_t bucket_size(size_t)
size_t bucket(const T&)
# C++20
bint contains(const T&)
|