00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00046 PB_ASSOC_CLASS_T_DEC
00047 inline typename PB_ASSOC_CLASS_C_DEC::const_data_reference
00048 PB_ASSOC_CLASS_C_DEC::
00049 const_subscript_imp(const_key_reference r_key, int_to_type<true>) const
00050 {
00051 PB_ASSOC_DBG_ONLY(assert_valid();)
00052
00053 return (const_cast<PB_ASSOC_CLASS_C_DEC& >(*this).find_key_pointer(r_key, my_traits_base::m_store_hash_indicator)->second);
00054 }
00055
00056 PB_ASSOC_CLASS_T_DEC
00057 inline typename PB_ASSOC_CLASS_C_DEC::pointer
00058 PB_ASSOC_CLASS_C_DEC::
00059 find_key_pointer(const_key_reference r_key, int_to_type<true>)
00060 {
00061 comp_hash pos_hash_pair = my_ranged_probe_fn_base::operator()(r_key);
00062
00063 size_type i;
00064
00065 my_resize_base::notify_find_search_start();
00066
00067
00068
00069 for (i = 0; i < m_num_e; ++i)
00070 {
00071 const size_type pos =
00072 my_ranged_probe_fn_base::operator()(r_key, pos_hash_pair.second, i);
00073
00074 entry* const p_e = m_a_entries + pos;
00075
00076 switch(p_e->m_stat)
00077 {
00078 case EMPTY_ENTRY_STATUS:
00079 {
00080 my_resize_base::notify_find_search_end();
00081
00082 PB_ASSOC_DBG_ONLY(my_map_debug_base::
00083 check_key_does_not_exist(r_key);)
00084
00085 return (NULL);
00086 }
00087 break;
00088 case VALID_ENTRY_STATUS:
00089 if (my_hash_eq_fn_base::operator()(
00090 PB_ASSOC_V2F(p_e->m_value),
00091 p_e->m_hash,
00092 r_key,
00093 pos_hash_pair.second))
00094 {
00095 my_resize_base::notify_find_search_end();
00096
00097 PB_ASSOC_DBG_ONLY(my_map_debug_base::check_key_exists(r_key);)
00098
00099 return ((pointer)&p_e->m_value);
00100 }
00101 break;
00102 case ERASED_ENTRY_STATUS:
00103 break;
00104 default:
00105 PB_ASSOC_DBG_ASSERT(0);
00106 };
00107
00108 my_resize_base::notify_find_search_collision();
00109 }
00110
00111 PB_ASSOC_DBG_ONLY(my_map_debug_base::
00112 check_key_does_not_exist(r_key);)
00113
00114 my_resize_base::notify_find_search_end();
00115
00116 return (NULL);
00117 }
00118