47 #ifdef PB_DS_HT_MAP_TRACE_
59 #ifdef PB_DS_DATA_TRUE_INDICATOR
60 #define PB_DS_GP_HASH_NAME gp_ht_map
63 #ifdef PB_DS_DATA_FALSE_INDICATOR
64 #define PB_DS_GP_HASH_NAME gp_ht_set
67 #define PB_DS_CLASS_T_DEC \
68 template<typename Key, typename Mapped, typename Hash_Fn, typename Eq_Fn, \
69 typename _Alloc, bool Store_Hash, typename Comb_Probe_Fn, \
70 typename Probe_Fn, typename Resize_Policy>
72 #define PB_DS_CLASS_C_DEC \
73 PB_DS_GP_HASH_NAME<Key, Mapped, Hash_Fn, Eq_Fn, _Alloc, \
74 Store_Hash, Comb_Probe_Fn, Probe_Fn, Resize_Policy>
76 #define PB_DS_HASH_EQ_FN_C_DEC \
77 hash_eq_fn<Key, Eq_Fn, _Alloc, Store_Hash>
79 #define PB_DS_RANGED_PROBE_FN_C_DEC \
80 ranged_probe_fn<Key, Hash_Fn, _Alloc, Comb_Probe_Fn, Probe_Fn, Store_Hash>
82 #define PB_DS_GP_HASH_TRAITS_BASE \
83 types_traits<Key, Mapped, _Alloc, Store_Hash>
86 #define PB_DS_DEBUG_MAP_BASE_C_DEC \
87 debug_map_base<Key, Eq_Fn, \
88 typename _Alloc::template rebind<Key>::other::const_reference>
133 template<
typename Key,
139 typename Comb_Probe_Fn,
141 typename Resize_Policy>
143 #ifdef _GLIBCXX_DEBUG
144 protected PB_DS_DEBUG_MAP_BASE_C_DEC,
147 public Resize_Policy,
167 struct entry :
public traits_base::stored_data_type
181 #ifdef _GLIBCXX_DEBUG
182 typedef PB_DS_DEBUG_MAP_BASE_C_DEC debug_base;
188 #define PB_DS_GEN_POS typename _Alloc::size_type
224 typedef typename traits_base::pointer
pointer;
229 #ifdef PB_DS_DATA_TRUE_INDICATOR
233 #ifdef PB_DS_DATA_FALSE_INDICATOR
239 #ifdef PB_DS_DATA_TRUE_INDICATOR
243 #ifdef PB_DS_DATA_FALSE_INDICATOR
263 const Probe_Fn&,
const Resize_Policy&);
265 template<
typename It>
325 inline std::pair<point_iterator, bool>
329 return insert_imp(r_val, traits_base::m_store_extra_indicator);
335 #ifdef PB_DS_DATA_TRUE_INDICATOR
336 return subscript_imp(r_key, traits_base::m_store_extra_indicator);
339 return traits_base::s_null_type;
343 inline point_iterator
349 inline point_iterator
358 template<
typename Pred>
377 #ifdef _GLIBCXX_DEBUG
379 assert_valid(
const char*,
int)
const;
382 #ifdef PB_DS_HT_MAP_TRACE_
388 #ifdef PB_DS_DATA_TRUE_INDICATOR
430 inline std::pair<point_iterator, bool>
433 inline std::pair<point_iterator, bool>
443 traits_base::m_store_extra_indicator);
453 return &p_e->m_value;
464 traits_base::m_store_extra_indicator);
471 p_e->m_hash = r_pos_hash_pair.second;
478 return &p_e->m_value;
481 #ifdef PB_DS_DATA_TRUE_INDICATOR
488 traits_base::m_store_extra_indicator);
495 return p_e->m_value.second;
504 traits_base::m_store_extra_indicator);
508 pos_hash_pair)->second;
518 const size_type hash = ranged_probe_fn_base::operator()(key);
519 resize_base::notify_find_search_start();
524 const size_type pos = ranged_probe_fn_base::operator()(key,
532 resize_base::notify_find_search_end();
538 if (hash_eq_fn_base::operator()(
PB_DS_V2F(p_e->m_value), key))
540 resize_base::notify_find_search_end();
551 resize_base::notify_find_search_collision();
555 resize_base::notify_find_search_end();
562 comp_hash pos_hash_pair = ranged_probe_fn_base::operator()(key);
563 resize_base::notify_find_search_start();
569 ranged_probe_fn_base::operator()(key, pos_hash_pair.second, i);
577 resize_base::notify_find_search_end();
583 if (hash_eq_fn_base::operator()(
PB_DS_V2F(p_e->m_value),
585 key, pos_hash_pair.second))
587 resize_base::notify_find_search_end();
598 resize_base::notify_find_search_collision();
602 resize_base::notify_find_search_end();
615 #ifdef PB_DS_DATA_TRUE_INDICATOR
625 for (++r_pos; r_pos <
m_num_e; ++r_pos)
630 r_p_value =& p_e->m_value;
640 for (r_pos = 0; r_pos <
m_num_e; ++r_pos)
645 r_p_value = &p_e->m_value;
655 for (r_pos = 0; r_pos <
m_num_e; ++r_pos)
660 r_p_value = &p_e->m_value;
667 #ifdef _GLIBCXX_DEBUG
670 const char*,
int)
const;
673 assert_entry_array_valid(
const entry_array, true_type,
674 const char*,
int)
const;
688 || !is_same<Hash_Fn, __gnu_pbds::null_type>::value
705 #undef PB_DS_CLASS_T_DEC
706 #undef PB_DS_CLASS_C_DEC
707 #undef PB_DS_HASH_EQ_FN_C_DEC
708 #undef PB_DS_RANGED_PROBE_FN_C_DEC
709 #undef PB_DS_GP_HASH_TRAITS_BASE
710 #undef PB_DS_DEBUG_MAP_BASE_C_DEC
711 #undef PB_DS_GP_HASH_NAME
void copy_from_range(It, It)
void get_start_it_state(pointer &r_p_value, size_type &r_pos)
Definition: gp_ht_map_.hpp:653
void erase_entry(entry_pointer)
Resize_Policy resize_policy
Definition: gp_ht_map_.hpp:205
Hash_Fn hash_fn
Definition: gp_ht_map_.hpp:201
void do_resize_if_needed_no_throw()
Probe_Fn & get_probe_fn()
Return current probe_fn.
void swap(PB_DS_CLASS_C_DEC &)
traits_base::const_reference const_reference_
Definition: gp_ht_map_.hpp:157
void get_start_it_state(const_pointer &r_p_value, size_type &r_pos) const
Definition: gp_ht_map_.hpp:638
_Alloc::size_type size_type
Definition: gp_ht_map_.hpp:199
Definition: gp_ht_map_.hpp:210
traits_base::const_pointer const_pointer
Definition: gp_ht_map_.hpp:225
entry_allocator::pointer entry_array
Definition: gp_ht_map_.hpp:177
#define PB_DS_RANGED_PROBE_FN_C_DEC
Definition: gp_ht_map_.hpp:79
traits_base::const_reference const_reference
Definition: gp_ht_map_.hpp:227
_Alloc::difference_type difference_type
Definition: gp_ht_map_.hpp:200
point_iterator find(key_const_reference)
PB_DS_RANGED_PROBE_FN_C_DEC ranged_probe_fn_base
Definition: gp_ht_map_.hpp:179
traits_base::mapped_pointer mapped_pointer
Definition: gp_ht_map_.hpp:219
traits_base::const_pointer const_pointer_
Definition: gp_ht_map_.hpp:155
void resize_imp_reassign(entry_pointer, entry_array, false_type)
#define _GLIBCXX_DEBUG_ASSERT(_Condition)
Definition: debug.h:61
pointer insert_new_imp(const_reference r_val, size_type pos)
Definition: gp_ht_map_.hpp:437
traits_base::pointer pointer
Definition: gp_ht_map_.hpp:224
Eq_Fn eq_fn
Definition: gp_ht_map_.hpp:202
#define _GLIBCXX_DEBUG_ONLY(_Statement)
Definition: debug.h:63
Hash_Fn & get_hash_fn()
Return current hash_fn.
Resize_Policy & get_resize_policy()
Return current resize_policy.
_Alloc allocator_type
Definition: gp_ht_map_.hpp:198
mapped_reference operator[](key_const_reference r_key)
Definition: gp_ht_map_.hpp:333
entry_allocator::const_reference const_entry_reference
Definition: gp_ht_map_.hpp:176
static iterator s_end_it
Definition: gp_ht_map_.hpp:678
traits_base::value_type value_type_
Definition: gp_ht_map_.hpp:153
traits_base::key_const_pointer key_const_pointer
Definition: gp_ht_map_.hpp:215
traits_base::pointer pointer_
Definition: gp_ht_map_.hpp:154
virtual ~PB_DS_GP_HASH_NAME()
Definition: gp_ht_map_.hpp:167
size_type m_num_used_e
Definition: gp_ht_map_.hpp:682
_Alloc::template rebind< entry >::other entry_allocator
Definition: gp_ht_map_.hpp:172
traits_base::key_const_reference key_const_reference
Definition: gp_ht_map_.hpp:217
PB_DS_GP_HASH_TRAITS_BASE traits_base
Definition: gp_ht_map_.hpp:152
#define PB_DS_HASH_EQ_FN_C_DEC
Definition: gp_ht_map_.hpp:76
traits_base::key_reference key_reference
Definition: gp_ht_map_.hpp:216
return(unsigned int) __res
bool erase_imp(key_const_reference, true_type)
static const_iterator s_const_end_it
Definition: gp_ht_map_.hpp:679
static entry_allocator s_entry_allocator
Definition: gp_ht_map_.hpp:677
Probe_Fn probe_fn
Definition: gp_ht_map_.hpp:203
traits_base::mapped_const_pointer mapped_const_pointer
Definition: gp_ht_map_.hpp:220
#define PB_DS_GP_HASH_TRAITS_BASE
Definition: gp_ht_map_.hpp:82
Definition: gp_ht_map_.hpp:142
PB_DS_HASH_EQ_FN_C_DEC hash_eq_fn_base
Definition: gp_ht_map_.hpp:185
Definition: gp_ht_map_.hpp:162
Comb_Probe_Fn comb_probe_fn
Definition: gp_ht_map_.hpp:204
void resize_imp(size_type)
Definition: gp_ht_map_.hpp:687
void inc_it_state(const_pointer &r_p_value, size_type &r_pos) const
Definition: gp_ht_map_.hpp:622
#define PB_DS_CLASS_C_DEC
Definition: gp_ht_map_.hpp:72
traits_base::value_type value_type
Definition: gp_ht_map_.hpp:223
traits_base::reference reference
Definition: gp_ht_map_.hpp:226
entry_allocator::reference entry_reference
Definition: gp_ht_map_.hpp:175
Eq_Fn & get_eq_fn()
Return current eq_fn.
traits_base::reference reference_
Definition: gp_ht_map_.hpp:156
point_const_iterator_ point_const_iterator
Definition: gp_ht_map_.hpp:237
const_iterator_ const_iterator
Definition: gp_ht_map_.hpp:247
virtual void do_resize(size_type)
entry_pointer m_entries
Definition: gp_ht_map_.hpp:683
Const range-type iterator.
Definition: const_iterator.hpp:43
std::tr1::integral_constant< int, 1 > true_type
Definition: type_utils.hpp:70
entry_allocator::pointer entry_pointer
Definition: gp_ht_map_.hpp:173
pointer find_key_pointer(key_const_reference key, false_type)
Definition: gp_ht_map_.hpp:516
size_type m_num_e
Definition: gp_ht_map_.hpp:681
Find type iterator.
Definition: point_iterator.hpp:43
Comb_Probe_Fn & get_comb_probe_fn()
Return current comb_probe_fn.
PB_DS_STATIC_ASSERT(sth, store_hash_ok)
Resize_Policy resize_base
Definition: gp_ht_map_.hpp:186
traits_base::comp_hash comp_hash
Definition: gp_ht_map_.hpp:158
#define PB_DS_CHECK_KEY_EXISTS(_Key)
Definition: container_base_dispatch.hpp:55
traits_base::key_type key_type
Definition: gp_ht_map_.hpp:213
entry_allocator::const_pointer const_entry_pointer
Definition: gp_ht_map_.hpp:174
bool erase(key_const_reference)
point_iterator find_end()
bool do_resize_if_needed()
bool empty() const
True if size() == 0.
void erase_all_valid_entries(entry_array, size_type)
Definition: gp_ht_map_.hpp:164
Range-type iterator.
Definition: iterator.hpp:43
size_type max_size() const
entry_status m_stat
Definition: gp_ht_map_.hpp:169
traits_base::key_pointer key_pointer
Definition: gp_ht_map_.hpp:214
std::pair< point_iterator, bool > insert_imp(const_reference, false_type)
#define PB_DS_V2F(X)
Definition: container_base_dispatch.hpp:80
pointer find_key_pointer(key_const_reference key, true_type)
Definition: gp_ht_map_.hpp:560
traits_base::mapped_reference mapped_reference
Definition: gp_ht_map_.hpp:221
entry_status
Definition: gp_ht_map_.hpp:160
Const point-type iterator.
Definition: point_const_iterator.hpp:45
__gnu_pbds::detail::PB_DS_GP_HASH_NAME::entry __attribute__
traits_base::mapped_const_reference mapped_const_reference
Definition: gp_ht_map_.hpp:222
std::pair< point_iterator, bool > insert(const_reference r_val)
Definition: gp_ht_map_.hpp:326
Definition: gp_ht_map_.hpp:163
traits_base::mapped_type mapped_type
Definition: gp_ht_map_.hpp:218
#define PB_DS_CHECK_KEY_DOES_NOT_EXIST(_Key)
Definition: container_base_dispatch.hpp:58
pointer insert_new_imp(const_reference r_val, comp_hash &r_pos_hash_pair)
Definition: gp_ht_map_.hpp:457
std::tr1::integral_constant< int, 0 > false_type
Definition: type_utils.hpp:71
size_type find_ins_pos(key_const_reference, false_type)