8#ifndef INCLUDED_BSLSTP_HASHMAP
9#define INCLUDED_BSLSTP_HASHMAP
109#ifdef BDE_OPENSOURCE_PUBLICATION
110#error "bslstp_hashmap is not for publication"
130template <
class _Key,
class _Tp,
132 typename ::BloombergLP::bslstp::HashSelector<_Key>::Type,
186 : _M_ht(__n, __hf, __eql, __a) {}
188 template <
class _InputIterator>
191 { _M_ht.insert_unique(__f, __l); }
192 template <
class _InputIterator>
195 { _M_ht.insert_unique(__f, __l); }
196 template <
class _InputIterator>
200 { _M_ht.insert_unique(__f, __l); }
203 template <
class _InputIterator>
206 { _M_ht.insert_unique(__f, __l); }
207 template <
class _InputIterator>
211 { _M_ht.insert_unique(__f, __l); }
212 template <
class _InputIterator>
216 { _M_ht.insert_unique(__f, __l); }
218 template <
class _InputIterator>
222 : _M_ht(__n, __hf, __eql, __a)
223 { _M_ht.insert_unique(__f, __l); }
229 : _M_ht(__x._M_ht, __a) { }
234 bool empty()
const {
return _M_ht.empty(); }
243 {
return _M_ht.insert_unique(__obj); }
244 template <
class _InputIterator>
245 void insert(_InputIterator __f, _InputIterator __l)
246 { _M_ht.insert_unique(__f,__l); }
248 {
return _M_ht.insert_unique_noresize(__obj); }
253 return _M_ht.find(__key);
258 if (__it == _M_ht.end())
266 return _M_ht._M_insert(
_value_type(__key, _Tp())).second;
269 return (*__it).second;
275 {
return _M_ht.equal_range(__key); }
278 {
return _M_ht.equal_range(__key); }
289 {
return _M_ht.elems_in_bucket(__n); }
295template <
class _Key,
class _Tp,
class _HashFcn,
class _EqualKey,
class _Alloc>
303template <
class _Key,
class _Tp,
305 typename ::BloombergLP::bslstp::HashSelector<_Key>::Type,
359 : _M_ht(__n, __hf, __eql, __a) {}
361 template <
class _InputIterator>
364 { _M_ht.insert_equal(__f, __l); }
365 template <
class _InputIterator>
368 { _M_ht.insert_equal(__f, __l); }
369 template <
class _InputIterator>
373 { _M_ht.insert_equal(__f, __l); }
376 template <
class _InputIterator>
380 { _M_ht.insert_equal(__f, __l); }
381 template <
class _InputIterator>
385 { _M_ht.insert_equal(__f, __l); }
386 template <
class _InputIterator>
390 { _M_ht.insert_equal(__f, __l); }
392 template <
class _InputIterator>
396 : _M_ht(__n, __hf, __eql, __a)
397 { _M_ht.insert_equal(__f, __l); }
403 : _M_ht(__x._M_ht, __a) { }
408 bool empty()
const {
return _M_ht.empty(); }
418 {
return _M_ht.insert_equal(__obj); }
419 template <
class _InputIterator>
420 void insert(_InputIterator __f, _InputIterator __l)
421 { _M_ht.insert_equal(__f,__l); }
423 {
return _M_ht.insert_equal_noresize(__obj); }
427 {
return _M_ht.find(__key); }
432 {
return _M_ht.equal_range(__key); }
435 {
return _M_ht.equal_range(__key); }
447 {
return _M_ht.elems_in_bucket(__n); }
453template <
class _Key,
class _Tp,
class _HashFcn,
class _EqualKey,
class _Alloc>
461template <
class _Key,
class _Tp,
class _HashFcn,
class _EqlKey,
class _Alloc>
469template <
class _Key,
class _Tp,
class _HashFcn,
class _EqlKey,
class _Alloc>
473 return !(__hm1 == __hm2);
476template <
class _Key,
class _Tp,
class _HashFcn,
class _EqlKey,
class _Alloc>
485 _Alloc>::_M_equal(__hm1, __hm2);
488template <
class _Key,
class _Tp,
class _HashFcn,
class _EqlKey,
class _Alloc>
493 return !(__hm1 == __hm2);
503template <
class _Key,
class _Tp,
class _HashFn,
class _EqKey,
class _Alloc>
504class insert_iterator<
505 bsl::hash_map<_Key, _Tp, _HashFn, _EqKey, _Alloc> > {
520 insert_iterator<_Container>&
525 insert_iterator<_Container>&
operator*() {
return *
this; }
527 insert_iterator<_Container>&
operator++(
int) {
return *
this; }
530template <
class _Key,
class _Tp,
class _HashFn,
class _EqKey,
class _Alloc>
531class insert_iterator<
bsl::hash_multimap<_Key, _Tp, _HashFn, _EqKey, _Alloc> >
548 insert_iterator<_Container>&
553 insert_iterator<_Container>&
operator*() {
return *
this; }
555 insert_iterator<_Container>&
operator++(
int) {
return *
this; }
Definition bslma_bslallocator.h:580
Definition bslstp_hashmap.h:136
_Ht::allocator_type allocator_type
Definition bslstp_hashmap.h:161
allocator_type get_allocator() const
Definition bslstp_hashmap.h:165
void erase(iterator __f, iterator __l)
Definition bslstp_hashmap.h:282
_Ht::difference_type difference_type
Definition bslstp_hashmap.h:152
_Ht::const_iterator const_iterator
Definition bslstp_hashmap.h:159
_Ht::reference reference
Definition bslstp_hashmap.h:155
size_type count(const key_type &__key) const
Definition bslstp_hashmap.h:272
hash_map(const allocator_type &__a)
Definition bslstp_hashmap.h:177
_Ht::value_type _value_type
Definition bslstp_hashmap.h:146
_Tp data_type
Definition bslstp_hashmap.h:144
const_iterator end() const
Definition bslstp_hashmap.h:239
void swap(_Self &__hs)
Definition bslstp_hashmap.h:235
hash_map(_InputIterator __f, _InputIterator __l, size_type __n, const allocator_type &__a)
Definition bslstp_hashmap.h:208
_Tp & operator[](const key_type &__key)
Definition bslstp_hashmap.h:256
size_type elems_in_bucket(size_type __n) const
Definition bslstp_hashmap.h:288
void insert(_InputIterator __f, _InputIterator __l)
Definition bslstp_hashmap.h:245
hash_map(_InputIterator __f, _InputIterator __l, size_type __n, const hasher &__hf, const allocator_type &__a)
Definition bslstp_hashmap.h:213
hash_map(_InputIterator __f, _InputIterator __l, const allocator_type &__a)
Definition bslstp_hashmap.h:204
const_iterator find(const key_type &__key) const
Definition bslstp_hashmap.h:251
iterator end()
Definition bslstp_hashmap.h:237
pair< iterator, bool > insert_noresize(const value_type &__obj)
Definition bslstp_hashmap.h:247
size_type bucket_count() const
Definition bslstp_hashmap.h:286
iterator begin()
Definition bslstp_hashmap.h:236
_Tp mapped_type
Definition bslstp_hashmap.h:145
hash_map(size_type __n, const allocator_type &__a)
Definition bslstp_hashmap.h:179
key_equal key_eq() const
Definition bslstp_hashmap.h:164
bool empty() const
Definition bslstp_hashmap.h:234
_Ht::size_type size_type
Definition bslstp_hashmap.h:151
pair< iterator, bool > insert(const value_type &__obj)
Definition bslstp_hashmap.h:242
_Ht::key_equal key_equal
Definition bslstp_hashmap.h:149
size_type size() const
Definition bslstp_hashmap.h:232
_Ht::pointer pointer
Definition bslstp_hashmap.h:153
hash_map(size_type __n, const hasher &__hf, const key_equal &__eql, const allocator_type &__a=allocator_type())
Definition bslstp_hashmap.h:184
_Ht::hasher hasher
Definition bslstp_hashmap.h:148
hash_map(size_type __n, const hasher &__hf, const allocator_type &__a)
Definition bslstp_hashmap.h:181
pair< const_iterator, const_iterator > equal_range(const key_type &__key) const
Definition bslstp_hashmap.h:277
hash_map(size_type __n)
Definition bslstp_hashmap.h:171
hash_map(size_type __n, const hasher &__hf)
Definition bslstp_hashmap.h:173
hasher hash_funct() const
Definition bslstp_hashmap.h:163
size_type erase(const key_type &__key)
Definition bslstp_hashmap.h:280
size_type max_bucket_count() const
Definition bslstp_hashmap.h:287
void resize(size_type __hint)
Definition bslstp_hashmap.h:285
void erase(iterator __it)
Definition bslstp_hashmap.h:281
const_iterator begin() const
Definition bslstp_hashmap.h:238
_Ht::const_reference const_reference
Definition bslstp_hashmap.h:156
pair< iterator, iterator > equal_range(const key_type &__key)
Definition bslstp_hashmap.h:274
_Ht::iterator iterator
Definition bslstp_hashmap.h:158
void clear()
Definition bslstp_hashmap.h:283
hash_map(_InputIterator __f, _InputIterator __l, size_type __n)
Definition bslstp_hashmap.h:193
hash_map(const _Self &__x, const allocator_type &__a)
Definition bslstp_hashmap.h:228
hash_map()
Definition bslstp_hashmap.h:170
iterator find(const key_type &__key)
Definition bslstp_hashmap.h:250
static bool _M_equal(const _Self &__x, const _Self &__y)
Definition bslstp_hashmap.h:290
hash_map(_InputIterator __f, _InputIterator __l)
Definition bslstp_hashmap.h:189
hash_map(_InputIterator __f, _InputIterator __l, size_type __n, const hasher &__hf, const key_equal &__eql, const allocator_type &__a=allocator_type())
Definition bslstp_hashmap.h:219
_Ht::key_type key_type
Definition bslstp_hashmap.h:143
size_type max_size() const
Definition bslstp_hashmap.h:233
_Ht::const_pointer const_pointer
Definition bslstp_hashmap.h:154
hash_map(_InputIterator __f, _InputIterator __l, size_type __n, const hasher &__hf)
Definition bslstp_hashmap.h:197
_Ht::value_type value_type
Definition bslstp_hashmap.h:147
Definition bslstp_hashmap.h:309
iterator end()
Definition bslstp_hashmap.h:412
size_type bucket_count() const
Definition bslstp_hashmap.h:444
bool empty() const
Definition bslstp_hashmap.h:408
_Ht::const_pointer const_pointer
Definition bslstp_hashmap.h:327
hash_multimap(size_type __n, const hasher &__hf)
Definition bslstp_hashmap.h:346
pair< const_iterator, const_iterator > equal_range(const key_type &__key) const
Definition bslstp_hashmap.h:434
hash_multimap(const _Self &__x, const allocator_type &__a)
Definition bslstp_hashmap.h:402
size_type count(const key_type &__key) const
Definition bslstp_hashmap.h:429
_Ht::hasher hasher
Definition bslstp_hashmap.h:321
hash_multimap(const allocator_type &__a)
Definition bslstp_hashmap.h:350
size_type max_size() const
Definition bslstp_hashmap.h:407
hash_multimap(_InputIterator __f, _InputIterator __l, size_type __n, const hasher &__hf, const key_equal &__eql, const allocator_type &__a=allocator_type())
Definition bslstp_hashmap.h:393
hash_multimap(_InputIterator __f, _InputIterator __l, size_type __n, const hasher &__hf)
Definition bslstp_hashmap.h:370
hasher hash_funct() const
Definition bslstp_hashmap.h:336
iterator begin()
Definition bslstp_hashmap.h:411
allocator_type get_allocator() const
Definition bslstp_hashmap.h:338
_Ht::size_type size_type
Definition bslstp_hashmap.h:324
const_iterator begin() const
Definition bslstp_hashmap.h:413
iterator find(const key_type &__key)
Definition bslstp_hashmap.h:425
_Ht::key_equal key_equal
Definition bslstp_hashmap.h:322
key_equal key_eq() const
Definition bslstp_hashmap.h:337
hash_multimap(size_type __n, const hasher &__hf, const key_equal &__eql, const allocator_type &__a=allocator_type())
Definition bslstp_hashmap.h:357
pair< iterator, iterator > equal_range(const key_type &__key)
Definition bslstp_hashmap.h:431
_Tp data_type
Definition bslstp_hashmap.h:317
const_iterator end() const
Definition bslstp_hashmap.h:414
hash_multimap(size_type __n, const allocator_type &__a)
Definition bslstp_hashmap.h:352
const_iterator find(const key_type &__key) const
Definition bslstp_hashmap.h:426
void resize(size_type __hint)
Definition bslstp_hashmap.h:443
hash_multimap(size_type __n, const hasher &__hf, const allocator_type &__a)
Definition bslstp_hashmap.h:354
size_type max_bucket_count() const
Definition bslstp_hashmap.h:445
void swap(_Self &__hs)
Definition bslstp_hashmap.h:409
_Ht::reference reference
Definition bslstp_hashmap.h:328
_value_type value_type
Definition bslstp_hashmap.h:320
hash_multimap()
Definition bslstp_hashmap.h:343
hash_multimap(_InputIterator __f, _InputIterator __l, size_type __n, const hasher &__hf, const allocator_type &__a)
Definition bslstp_hashmap.h:387
_Ht::const_iterator const_iterator
Definition bslstp_hashmap.h:332
size_type elems_in_bucket(size_type __n) const
Definition bslstp_hashmap.h:446
_Ht::iterator iterator
Definition bslstp_hashmap.h:331
hash_multimap(_InputIterator __f, _InputIterator __l)
Definition bslstp_hashmap.h:362
size_type size() const
Definition bslstp_hashmap.h:406
_Ht::allocator_type allocator_type
Definition bslstp_hashmap.h:334
_Ht::difference_type difference_type
Definition bslstp_hashmap.h:325
hash_multimap(_InputIterator __f, _InputIterator __l, size_type __n, const allocator_type &__a)
Definition bslstp_hashmap.h:382
_Ht::value_type _value_type
Definition bslstp_hashmap.h:319
_Ht::key_type key_type
Definition bslstp_hashmap.h:316
_Ht::pointer pointer
Definition bslstp_hashmap.h:326
size_type erase(const key_type &__key)
Definition bslstp_hashmap.h:437
iterator insert_noresize(const value_type &__obj)
Definition bslstp_hashmap.h:422
hash_multimap(_InputIterator __f, _InputIterator __l, const allocator_type &__a)
Definition bslstp_hashmap.h:377
hash_multimap(_InputIterator __f, _InputIterator __l, size_type __n)
Definition bslstp_hashmap.h:366
void insert(_InputIterator __f, _InputIterator __l)
Definition bslstp_hashmap.h:420
static bool _M_equal(const _Self &__x, const _Self &__y)
Definition bslstp_hashmap.h:448
_Ht::const_reference const_reference
Definition bslstp_hashmap.h:329
_Tp mapped_type
Definition bslstp_hashmap.h:318
hash_multimap(size_type __n)
Definition bslstp_hashmap.h:344
iterator insert(const value_type &__obj)
Definition bslstp_hashmap.h:417
void clear()
Definition bslstp_hashmap.h:440
void erase(iterator __it)
Definition bslstp_hashmap.h:438
void erase(iterator __f, iterator __l)
Definition bslstp_hashmap.h:439
Definition bslstp_hashtable.h:230
hasher hash_funct() const
Definition bslstp_hashtable.h:247
_HF hasher
Definition bslstp_hashtable.h:236
value_type & reference
Definition bslstp_hashtable.h:243
ptrdiff_t difference_type
Definition bslstp_hashtable.h:240
allocator_type get_allocator() const
Definition bslstp_hashtable.h:281
_Key key_type
Definition bslstp_hashtable.h:234
static bool _M_equal(const hashtable< _Val, _Key, _HF, _ExK, _EqK, _All > &, const hashtable< _Val, _Key, _HF, _ExK, _EqK, _All > &)
Definition bslstp_hashtable.h:703
key_equal key_eq() const
Definition bslstp_hashtable.h:248
value_type * pointer
Definition bslstp_hashtable.h:241
const value_type & const_reference
Definition bslstp_hashtable.h:244
_EqK key_equal
Definition bslstp_hashtable.h:237
_Val value_type
Definition bslstp_hashtable.h:235
const value_type * const_pointer
Definition bslstp_hashtable.h:242
size_t size_type
Definition bslstp_hashtable.h:239
_Alloc_traits< _Val, _All >::allocator_type allocator_type
Definition bslstp_hashtable.h:280
Definition bslstl_pair.h:1210
insert_iterator< _Container > & operator++()
Definition bslstp_hashmap.h:526
_Container container_type
Definition bslstp_hashmap.h:510
insert_iterator< _Container > & operator=(const typename _Container::value_type &__val)
Definition bslstp_hashmap.h:521
insert_iterator(_Container &__x, typename _Container::iterator)
Definition bslstp_hashmap.h:518
insert_iterator(_Container &__x)
Definition bslstp_hashmap.h:517
insert_iterator< _Container > & operator++(int)
Definition bslstp_hashmap.h:527
void difference_type
Definition bslstp_hashmap.h:513
insert_iterator< _Container > & operator*()
Definition bslstp_hashmap.h:525
void reference
Definition bslstp_hashmap.h:515
_Container * container
Definition bslstp_hashmap.h:508
void value_type
Definition bslstp_hashmap.h:512
bsl::hash_map< _Key, _Tp, _HashFn, _EqKey, _Alloc > _Container
Definition bslstp_hashmap.h:507
output_iterator_tag iterator_category
Definition bslstp_hashmap.h:511
void pointer
Definition bslstp_hashmap.h:514
output_iterator_tag iterator_category
Definition bslstp_hashmap.h:539
insert_iterator< _Container > & operator=(const typename _Container::value_type &__val)
Definition bslstp_hashmap.h:549
_Container container_type
Definition bslstp_hashmap.h:538
void reference
Definition bslstp_hashmap.h:543
insert_iterator(_Container &__x)
Definition bslstp_hashmap.h:545
bsl::hash_multimap< _Key, _Tp, _HashFn, _EqKey, _Alloc > _Container
Definition bslstp_hashmap.h:534
_Container * container
Definition bslstp_hashmap.h:535
void difference_type
Definition bslstp_hashmap.h:541
insert_iterator< _Container > & operator++()
Definition bslstp_hashmap.h:554
insert_iterator(_Container &__x, typename _Container::iterator)
Definition bslstp_hashmap.h:546
insert_iterator< _Container > & operator*()
Definition bslstp_hashmap.h:553
insert_iterator< _Container > & operator++(int)
Definition bslstp_hashmap.h:555
void pointer
Definition bslstp_hashmap.h:542
_Container::iterator iter
Definition bslstp_hashmap.h:536
void value_type
Definition bslstp_hashmap.h:540
Definition bdlb_printmethods.h:283
Definition bdlc_flathashmap.h:1805
Definition balxml_encoderoptions.h:68
Definition bdldfp_decimal.h:5188
Definition bslstp_hashtable.h:146
Definition bslstl_equalto.h:311
Definition bslmf_isconvertible.h:867
public type names
Definition bslstp_exfunctional.h:211
Definition bslalg_hasstliterators.h:99
Definition bslma_usesbslmaallocator.h:343