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
00045 template<class Base, bool Lowest>
00046 struct base_it_key_type
00047 {
00048 typedef typename Base::it_key_type type;
00049 };
00050
00051 template<class Base>
00052 struct base_it_key_type<
00053 Base,
00054 true>
00055 {
00056 typedef typename Base::const_key_reference type;
00057 };
00058
00059 template<typename Base_Key_,
00060 typename Key_,
00061 typename Data_,
00062 typename Value_,
00063 class Allocator_ >
00064 struct it_value_type_traits_
00065 {
00066 typedef ref_pair< Base_Key_, Key_> key_ref_pair;
00067
00068 typedef
00069 typename Allocator_::template rebind<
00070 key_ref_pair>::other::const_reference
00071 key_ref_pair_val;
00072
00073 typedef key_ref_pair_val key_type;
00074
00075 typedef ref_pair< key_ref_pair_val, Data_> value_type;
00076
00077 typedef
00078 typename Allocator_::template rebind<
00079 value_type>::other::reference
00080 reference;
00081
00082 typedef
00083 typename Allocator_::template rebind<
00084 value_type>::other::const_reference
00085 const_reference;
00086
00087 typedef
00088 typename Allocator_::template rebind<
00089 value_type>::other::pointer
00090 pointer;
00091
00092 typedef
00093 typename Allocator_::template rebind<
00094 value_type>::other::const_pointer
00095 const_pointer;
00096
00097 struct value_type_holder
00098 {
00099 typename std::tr1::aligned_storage<sizeof(key_ref_pair),
00100 std::tr1::alignment_of<key_ref_pair>::value>::type m_a_key_buf;
00101
00102 typename std::tr1::aligned_storage<sizeof(value_type),
00103 std::tr1::alignment_of<value_type>::value>::type m_a_value_buf;
00104 };
00105
00106 typedef
00107 typename Allocator_::template rebind<
00108 value_type_holder>::other::reference
00109 value_type_hoder_valerence;
00110
00111 inline static pointer
00112 recast(value_type_hoder_valerence r_holder)
00113 {
00114 return reinterpret_cast<pointer>(&r_holder.m_a_value_buf);
00115 }
00116
00117 inline static void
00118 make_valid(value_type_hoder_valerence r_holder, Base_Key_ r_bk, Value_ r_val)
00119 {
00120 typedef
00121 typename Allocator_::template rebind<
00122 void* >::other::value_type
00123 void_pointer;
00124
00125 void_pointer p_target = &r_holder.m_a_key_buf;
00126
00127 new (p_target) key_ref_pair(r_bk, r_val.first);
00128
00129 typedef
00130 typename Allocator_::template rebind<
00131 key_ref_pair>::other::pointer
00132 key_ref_pair_pointer;
00133
00134 key_ref_pair_pointer p_key =
00135 reinterpret_cast<key_ref_pair_pointer>(&r_holder.m_a_key_buf);
00136
00137 p_target = &r_holder.m_a_value_buf;
00138
00139 new (p_target) value_type(*p_key, r_val.second);
00140 }
00141 };
00142
00143 template<typename Base_Key_,
00144 typename Key_,
00145 typename Value_,
00146 class Allocator_>
00147 struct it_value_type_traits_<
00148 Base_Key_,
00149 Key_,
00150 null_data_type,
00151 Value_,
00152 Allocator_>
00153 {
00154 typedef ref_pair< Base_Key_, Key_> key_ref_pair;
00155
00156 typedef
00157 typename Allocator_::template rebind<
00158 key_ref_pair>::other::const_reference
00159 key_ref_pair_val;
00160
00161 typedef key_ref_pair_val key_type;
00162
00163 typedef key_ref_pair value_type;
00164
00165 typedef
00166 typename Allocator_::template rebind<
00167 value_type>::other::const_reference
00168 reference;
00169
00170 typedef
00171 typename Allocator_::template rebind<
00172 value_type>::other::const_reference
00173 const_reference;
00174
00175 typedef
00176 typename Allocator_::template rebind<
00177 value_type>::other::const_pointer
00178 pointer;
00179
00180 typedef
00181 typename Allocator_::template rebind<
00182 value_type>::other::const_pointer
00183 const_pointer;
00184
00185 struct value_type_holder
00186 {
00187 typename std::tr1::aligned_storage<sizeof(key_ref_pair),
00188 std::tr1::alignment_of<key_ref_pair>::value>::type m_a_key_buf;
00189
00190 typename std::tr1::aligned_storage<sizeof(value_type),
00191 std::tr1::alignment_of<value_type>::value>::type m_a_value_buf;
00192 };
00193
00194 typedef
00195 typename Allocator_::template rebind<
00196 value_type_holder>::other::reference
00197 value_type_hoder_valerence;
00198
00199 inline static pointer
00200 recast(value_type_hoder_valerence r_holder)
00201 {
00202 return reinterpret_cast<pointer>(&r_holder.m_a_value_buf);
00203 }
00204
00205 inline static void
00206 make_valid(value_type_hoder_valerence r_holder, Base_Key_ r_bk, Value_ r_val)
00207 {
00208 typedef
00209 typename Allocator_::template rebind<
00210 void* >::other::value_type
00211 void_pointer;
00212
00213 void_pointer p_target = &r_holder.m_a_value_buf;
00214
00215 new (p_target) key_ref_pair(r_bk, r_val.first);
00216 }
00217 };
00218