1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" 2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 3 4<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> 5<head> 6 <meta name="generator" content= 7 "HTML Tidy for Linux/x86 (vers 12 April 2005), see www.w3.org" /> 8 9 <title>sample_resize_policy Interface</title> 10 <meta http-equiv="Content-Type" content= 11 "text/html; charset=us-ascii" /> 12 </head> 13 14<body> 15 <div id="page"> 16 <h1><tt>sample_resize_policy</tt> Interface</h1> 17 18 <p>A sample resize policy.</p> 19 20 <p>This class serves to show the interface a resize policy 21 needs to support.</p> 22 23 <p>Defined in: <a href= 24 "http://gcc.gnu.org/viewcvs/*checkout*/trunk/libstdc%2B%2B-v3/include/ext/pb_ds/detail/resize_policy/sample_resize_policy.hpp"><tt>sample_resize_policy.hpp</tt></a></p> 25 26 <h2><a name="link1" id="link1">Public Types and 27 Constants</a></h2> 28 29 <h3><a name="link2" id="link2">General definitions.</a></h3> 30 31 <table class="c1" width="100%" border="1" summary="Types"> 32 <tr> 33 <td width="30%" align="left"><b>Type</b></td> 34 35 <td width="55%" align="left"><b>Definition</b></td> 36 37 <td width="15%" align="left"><b>Description</b></td> 38 </tr> 39 40 <tr> 41 <td> 42 <pre> 43<a name="size_type55424436" id="size_type55424436">size_type</a> 44</pre> 45 </td> 46 47 <td> 48 <pre> 49size_t, e.g. 50</pre> 51 </td> 52 53 <td> 54 <p>Size type.</p> 55 </td> 56 </tr> 57 </table> 58 59 <h2><a name="link3" id="link3">Public Methods</a></h2> 60 61 <h3><a name="link4" id="link4">Constructors, destructor, and 62 related.</a></h3> 63 64 <table class="c1" width="100%" border="1" summary="Methods"> 65 <tr> 66 <td width="45%" align="left"><b>Method</b></td> 67 68 <td width="55%" align="left"><b>Description</b></td> 69 </tr> 70 71 <tr> 72 <td> 73 <pre> 74 sample_resize_policy 75 () 76</pre> 77 </td> 78 79 <td> 80 <p>Default constructor.</p> 81 82 <p>Must be default constructable.</p> 83 </td> 84 </tr> 85 86 <tr> 87 <td> 88 <pre> 89 sample_range_hashing 90 (<b>const</b> sample_resize_policy &other) 91</pre> 92 </td> 93 94 <td> 95 <p>Copy constructor.</p> 96 97 <p>Must be copy constructable.</p> 98 </td> 99 </tr> 100 101 <tr> 102 <td> 103 <pre> 104<b>inline</b> <b>void</b> 105 swap 106 (sample_resize_policy &other) 107</pre> 108 </td> 109 110 <td> 111 <p>Swaps content.</p> 112 113 <p>Must be swappable (if there is such a word).</p> 114 </td> 115 </tr> 116 </table> 117 118 <h2><a name="link5" id="link5">Protected Methods</a></h2> 119 120 <h3><a name="link6" id="link6">Insert search 121 notifications.</a></h3> 122 123 <p>Notifications called during an insert operation.</p> 124 125 <table class="c1" width="100%" border="1" summary="Methods"> 126 <tr> 127 <td width="45%" align="left"><b>Method</b></td> 128 129 <td width="55%" align="left"><b>Description</b></td> 130 </tr> 131 132 <tr> 133 <td> 134 <pre> 135<b>inline</b> <b>void</b> 136 notify_insert_search_start 137 () 138</pre> 139 </td> 140 141 <td> 142 <p>Notifies a search started.</p> 143 </td> 144 </tr> 145 146 <tr> 147 <td> 148 <pre> 149<b>inline</b> <b>void</b> 150 notify_insert_search_collision 151 () 152</pre> 153 </td> 154 155 <td> 156 <p>Notifies a search encountered a collision.</p> 157 </td> 158 </tr> 159 160 <tr> 161 <td> 162 <pre> 163<b>inline</b> <b>void</b> 164 notify_insert_search_end 165 () 166</pre> 167 </td> 168 169 <td> 170 <p>Notifies a search ended.</p> 171 </td> 172 </tr> 173 </table> 174 175 <h3><a name="link7" id="link7">Find search 176 notifications.</a></h3> 177 178 <p>Notifications called during a find operation.</p> 179 180 <table class="c1" width="100%" border="1" summary="Methods"> 181 <tr> 182 <td width="45%" align="left"><b>Method</b></td> 183 184 <td width="55%" align="left"><b>Description</b></td> 185 </tr> 186 187 <tr> 188 <td> 189 <pre> 190<b>inline</b> <b>void</b> 191 notify_find_search_start 192 () 193</pre> 194 </td> 195 196 <td> 197 <p>Notifies a search started.</p> 198 </td> 199 </tr> 200 201 <tr> 202 <td> 203 <pre> 204<b>inline</b> <b>void</b> 205 notify_find_search_collision 206 () 207</pre> 208 </td> 209 210 <td> 211 <p>Notifies a search encountered a collision.</p> 212 </td> 213 </tr> 214 215 <tr> 216 <td> 217 <pre> 218<b>inline</b> <b>void</b> 219 notify_find_search_end 220 () 221</pre> 222 </td> 223 224 <td> 225 <p>Notifies a search ended.</p> 226 </td> 227 </tr> 228 </table> 229 230 <h3><a name="link8" id="link8">Erase search 231 notifications.</a></h3> 232 233 <p>Notifications called during an insert operation.</p> 234 235 <table class="c1" width="100%" border="1" summary="Methods"> 236 <tr> 237 <td width="45%" align="left"><b>Method</b></td> 238 239 <td width="55%" align="left"><b>Description</b></td> 240 </tr> 241 242 <tr> 243 <td> 244 <pre> 245<b>inline</b> <b>void</b> 246 notify_erase_search_start 247 () 248</pre> 249 </td> 250 251 <td> 252 <p>Notifies a search started.</p> 253 </td> 254 </tr> 255 256 <tr> 257 <td> 258 <pre> 259<b>inline</b> <b>void</b> 260 notify_erase_search_collision 261 () 262</pre> 263 </td> 264 265 <td> 266 <p>Notifies a search encountered a collision.</p> 267 </td> 268 </tr> 269 270 <tr> 271 <td> 272 <pre> 273<b>inline</b> <b>void</b> 274 notify_erase_search_end 275 () 276</pre> 277 </td> 278 279 <td> 280 <p>Notifies a search ended.</p> 281 </td> 282 </tr> 283 </table> 284 285 <h3><a name="link9" id="link9">Content change 286 notifications.</a></h3> 287 288 <p>Notifications called when the content of the table changes 289 in a way that can affect the resize policy.</p> 290 291 <table class="c1" width="100%" border="1" summary="Methods"> 292 <tr> 293 <td width="45%" align="left"><b>Method</b></td> 294 295 <td width="55%" align="left"><b>Description</b></td> 296 </tr> 297 298 <tr> 299 <td> 300 <pre> 301<b>inline</b> <b>void</b> 302 notify_inserted 303 (<a href="#size_type55424436"><tt>size_type</tt></a> num_e) 304</pre> 305 </td> 306 307 <td> 308 <p>Notifies an element was inserted.</p> 309 </td> 310 </tr> 311 312 <tr> 313 <td> 314 <pre> 315<b>inline</b> <b>void</b> 316 notify_erased 317 (<a href="#size_type55424436"><tt>size_type</tt></a> num_e) 318</pre> 319 </td> 320 321 <td> 322 <p>Notifies an element was erased.</p> 323 </td> 324 </tr> 325 326 <tr> 327 <td> 328 <pre> 329<b>void</b> 330 notify_cleared 331 () 332</pre> 333 </td> 334 335 <td> 336 <p>Notifies the table was cleared.</p> 337 </td> 338 </tr> 339 </table> 340 341 <h3><a name="link10" id="link10">Size change 342 notifications.</a></h3> 343 344 <p>Notifications called when the table changes size.</p> 345 346 <table class="c1" width="100%" border="1" summary="Methods"> 347 <tr> 348 <td width="45%" align="left"><b>Method</b></td> 349 350 <td width="55%" align="left"><b>Description</b></td> 351 </tr> 352 353 <tr> 354 <td> 355 <pre> 356<b>void</b> 357 notify_resized 358 (<a href="#size_type55424436"><tt>size_type</tt></a> new_size) 359</pre> 360 </td> 361 362 <td> 363 <p>Notifies the table was resized to <span class= 364 "c1"><tt>new_size</tt></span>.</p> 365 </td> 366 </tr> 367 </table> 368 369 <h3><a name="link11" id="link11">Queries.</a></h3> 370 371 <p>Called to query whether/how to resize.</p> 372 373 <table class="c1" width="100%" border="1" summary="Methods"> 374 <tr> 375 <td width="45%" align="left"><b>Method</b></td> 376 377 <td width="55%" align="left"><b>Description</b></td> 378 </tr> 379 380 <tr> 381 <td> 382 <pre> 383<b>inline</b> <b>bool</b> 384 is_resize_needed 385 () <b>const</b> 386</pre> 387 </td> 388 389 <td> 390 <p>Queries whether a resize is needed.</p> 391 </td> 392 </tr> 393 394 <tr> 395 <td> 396 <pre> 397<a href="#size_type55424436"><tt>size_type</tt></a> 398 get_new_size 399 (<a href="#size_type55424436"><tt>size_type</tt></a> size, 400 <a href= 401"#size_type55424436"><tt>size_type</tt></a> num_used_e) <b>const</b> 402</pre> 403 </td> 404 405 <td> 406 <p>Queries what the new <span class= 407 "c1"><tt>size</tt></span> should be.</p> 408 </td> 409 </tr> 410 </table> 411 </div> 412</body> 413</html> 414