1 2<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> 3 4 5<html> 6<head> 7<title>cc_hash_max_collision_check_resize_trigger Interface 8</title> 9 10</head> 11 12<body> 13<h1> 14<tt>cc_hash_max_collision_check_resize_trigger 15</tt> 16 17 Interface 18 19 20</h1> 21 22<p>A resize trigger policy based on collision checks. It keeps the simulated load factor lower than some given load factor. 23</p> 24 25<ol> 26<li> 27<a href = "../../../../include/ext/pb_assoc/hash_policy.hpp"><tt>hash_policy.hpp</tt> 28</a> 29 30</li> 31 32<li> 33<a href = "#link1">Template parameters. 34</a> 35 36</li> 37 38<li> 39Public Types and Constants: 40 41 42<ol> 43<li> 44<a href = "#link2">General definitions. 45</a> 46 47</li> 48 49</ol> 50 51</li> 52 53<li> 54Public Methods: 55 56 57<ol> 58<li> 59<a href = "#link3">Constructors, destructor, and related. 60</a> 61 62</li> 63 64<li> 65<a href = "#link4">Load access methods. 66</a> 67 68</li> 69 70</ol> 71 72</li> 73 74<li> 75Protected Methods: 76 77 78<ol> 79<li> 80<a href = "#link5">Insert search notifications. 81</a> 82 83</li> 84 85<li> 86<a href = "#link6">Find search notifications. 87</a> 88 89</li> 90 91<li> 92<a href = "#link7">Erase search notifications. 93</a> 94 95</li> 96 97<li> 98<a href = "#link8">Content change notifications. 99</a> 100 101</li> 102 103<li> 104<a href = "#link9">Size change notifications. 105</a> 106 107</li> 108 109<li> 110<a href = "#link10">Queries. 111</a> 112 113</li> 114 115</ol> 116 117</li> 118 119</ol> 120 121 122<h2> 123<a name = "link1">Template parameters. 124</a> 125 126</h2> 127 128<table WIDTH = "100%" BORDER = "1"> 129<TR><TD Width = "20%" ALIGN = "left"><b>Parameter</b></TD><TD Width = "50%" ALIGN = "left"><b>Description</b></TD><TD Width = "30%" ALIGN = "left"><b>Default Value</b></TD></TR> 130 131 132<tr> 133<td> 134<pre><a name = "External_Load_Access3735929540">External_Load_Access</a></pre> 135 136 137</td> 138 139<td> 140<p>Specifies whether the load factor can be accessed externally. The two options have different tradeoffs in terms of flexibility, genericity, and encapsulation.</p> 141 142 143</td> 144 145<td> 146<tt><b>false</b></tt> 147 148 149</td> 150 151</tr> 152 153<tr> 154<td> 155<pre><a name = "Size_Type3735929483">Size_Type</a></pre> 156 157 158</td> 159 160<td> 161<p>Size type.</p> 162 163 164</td> 165 166<td> 167size_t 168 169 170</td> 171 172</tr> 173 174</table> 175 176<h2> 177<a name = "link2">General definitions. 178</a> 179 180</h2> 181 182<table WIDTH = "100%" BORDER = "1"> 183<TR><TD Width = "30%" ALIGN = "left"><b>Type</b></TD><TD Width = "55%" ALIGN = "left"><b>Definition</b></TD><TD Width = "15%" ALIGN = "left"><b>Description</b></TD></TR> 184 185 186<tr> 187<td> 188<pre><a name = "size_type3735929547">size_type</a></pre> 189 190 191</td> 192 193<td> 194<pre><a href = "#Size_Type3735929483">Size_Type</a></pre> 195 196 197</td> 198 199<td> 200<p>Size type.</p> 201 202 203</td> 204 205</tr> 206 207<tr> 208<td> 209<pre><a name = "external_load_access3735929604">external_load_access</a></pre> 210 211 212</td> 213 214<td> 215<pre><a href = "#External_Load_Access3735929540">External_Load_Access</a></pre> 216 217 218</td> 219 220<td> 221<p>Indicates whether loads can be accessed externally</p> 222 223 224</td> 225 226</tr> 227 228</table> 229 230<h2> 231<a name = "link3">Constructors, destructor, and related. 232</a> 233 234</h2> 235 236<table WIDTH = "100%" BORDER = "1"> 237<TR><TD Width = "45%" ALIGN = "left"><b>Method</b></TD><TD Width = "55%" ALIGN = "left"><b>Description</b></TD></TR> 238 239 240<tr> 241<td> 242<pre> cc_hash_max_collision_check_resize_trigger 243 (float load = 0.5)</pre> 244 245 246</td> 247 248<td> 249<p>Default constructor, or constructor taking <font color = "#666666"><tt>load</tt></font>, a load factor which it will attempt to maintain.</p> 250 251 252</td> 253 254</tr> 255 256<tr> 257<td> 258<pre><b>void</b> 259 swap 260 (<font color = "olive">cc_hash_max_collision_check_resize_trigger</font> &r_other)</pre> 261 262 263</td> 264 265<td> 266<p>Swaps content.</p> 267 268 269</td> 270 271</tr> 272 273</table> 274 275<h2> 276<a name = "link4">Load access methods. 277</a> 278 279</h2> 280 281<p> These methods are only available if the external access parameter is set.</p> 282 283 284<table WIDTH = "100%" BORDER = "1"> 285<TR><TD Width = "45%" ALIGN = "left"><b>Method</b></TD><TD Width = "55%" ALIGN = "left"><b>Description</b></TD></TR> 286 287 288<tr> 289<td> 290<pre><b>inline</b> float 291 get_load 292 () <b>const</b></pre> 293 294 295</td> 296 297<td> 298<p>Returns a pair of the minimal and maximal loads, respectively.</p> 299 300 301<p>Calling this method will not compile when <a href = "#External_Load_Access3735929540"><tt>External_Load_Access</tt></a> == <tt><b>false</b></tt>.</p> 302 303 304</td> 305 306</tr> 307 308</table> 309 310<h2> 311<a name = "link5">Insert search notifications. 312</a> 313 314</h2> 315 316<p>Notifications called during an insert operation.</p> 317 318 319<table WIDTH = "100%" BORDER = "1"> 320<TR><TD Width = "45%" ALIGN = "left"><b>Method</b></TD><TD Width = "55%" ALIGN = "left"><b>Description</b></TD></TR> 321 322 323<tr> 324<td> 325<pre><b>inline</b> <b>void</b> 326 notify_insert_search_start 327 ()</pre> 328 329 330</td> 331 332<td> 333<p>Notifies a search started.</p> 334 335 336</td> 337 338</tr> 339 340<tr> 341<td> 342<pre><b>inline</b> <b>void</b> 343 notify_insert_search_collision 344 ()</pre> 345 346 347</td> 348 349<td> 350<p>Notifies a search encountered a collision.</p> 351 352 353</td> 354 355</tr> 356 357<tr> 358<td> 359<pre><b>inline</b> <b>void</b> 360 notify_insert_search_end 361 ()</pre> 362 363 364</td> 365 366<td> 367<p>Notifies a search ended.</p> 368 369 370</td> 371 372</tr> 373 374</table> 375 376<h2> 377<a name = "link6">Find search notifications. 378</a> 379 380</h2> 381 382<p>Notifications called during a find operation.</p> 383 384 385<table WIDTH = "100%" BORDER = "1"> 386<TR><TD Width = "45%" ALIGN = "left"><b>Method</b></TD><TD Width = "55%" ALIGN = "left"><b>Description</b></TD></TR> 387 388 389<tr> 390<td> 391<pre><b>inline</b> <b>void</b> 392 notify_find_search_start 393 ()</pre> 394 395 396</td> 397 398<td> 399<p>Notifies a search started.</p> 400 401 402</td> 403 404</tr> 405 406<tr> 407<td> 408<pre><b>inline</b> <b>void</b> 409 notify_find_search_collision 410 ()</pre> 411 412 413</td> 414 415<td> 416<p>Notifies a search encountered a collision.</p> 417 418 419</td> 420 421</tr> 422 423<tr> 424<td> 425<pre><b>inline</b> <b>void</b> 426 notify_find_search_end 427 ()</pre> 428 429 430</td> 431 432<td> 433<p>Notifies a search ended.</p> 434 435 436</td> 437 438</tr> 439 440</table> 441 442<h2> 443<a name = "link7">Erase search notifications. 444</a> 445 446</h2> 447 448<p>Notifications called during an insert operation.</p> 449 450 451<table WIDTH = "100%" BORDER = "1"> 452<TR><TD Width = "45%" ALIGN = "left"><b>Method</b></TD><TD Width = "55%" ALIGN = "left"><b>Description</b></TD></TR> 453 454 455<tr> 456<td> 457<pre><b>inline</b> <b>void</b> 458 notify_erase_search_start 459 ()</pre> 460 461 462</td> 463 464<td> 465<p>Notifies a search started.</p> 466 467 468</td> 469 470</tr> 471 472<tr> 473<td> 474<pre><b>inline</b> <b>void</b> 475 notify_erase_search_collision 476 ()</pre> 477 478 479</td> 480 481<td> 482<p>Notifies a search encountered a collision.</p> 483 484 485</td> 486 487</tr> 488 489<tr> 490<td> 491<pre><b>inline</b> <b>void</b> 492 notify_erase_search_end 493 ()</pre> 494 495 496</td> 497 498<td> 499<p>Notifies a search ended.</p> 500 501 502</td> 503 504</tr> 505 506</table> 507 508<h2> 509<a name = "link8">Content change notifications. 510</a> 511 512</h2> 513 514<p>Notifications called when the content of the table changes in a way that can affect the resize policy.</p> 515 516 517<table WIDTH = "100%" BORDER = "1"> 518<TR><TD Width = "45%" ALIGN = "left"><b>Method</b></TD><TD Width = "55%" ALIGN = "left"><b>Description</b></TD></TR> 519 520 521<tr> 522<td> 523<pre><b>inline</b> <b>void</b> 524 notify_inserted 525 (<a href = "#size_type3735929547">size_type</a> num_entries)</pre> 526 527 528</td> 529 530<td> 531<p>Notifies an element was inserted.</p> 532 533 534</td> 535 536</tr> 537 538<tr> 539<td> 540<pre><b>inline</b> <b>void</b> 541 notify_erased 542 (<a href = "#size_type3735929547">size_type</a> num_entries)</pre> 543 544 545</td> 546 547<td> 548<p>Notifies an element was erased.</p> 549 550 551</td> 552 553</tr> 554 555<tr> 556<td> 557<pre><b>void</b> 558 notify_cleared 559 ()</pre> 560 561 562</td> 563 564<td> 565<p>Notifies the table was cleared.</p> 566 567 568</td> 569 570</tr> 571 572</table> 573 574<h2> 575<a name = "link9">Size change notifications. 576</a> 577 578</h2> 579 580<p>Notifications called when the table changes size.</p> 581 582 583<table WIDTH = "100%" BORDER = "1"> 584<TR><TD Width = "45%" ALIGN = "left"><b>Method</b></TD><TD Width = "55%" ALIGN = "left"><b>Description</b></TD></TR> 585 586 587<tr> 588<td> 589<pre><b>void</b> 590 notify_resized 591 (<a href = "#size_type3735929547">size_type</a> new_size)</pre> 592 593 594</td> 595 596<td> 597<p>Notifies the table was resized as a result of this object's signifying that a resize is needed.</p> 598 599 600</td> 601 602</tr> 603 604<tr> 605<td> 606<pre><b>void</b> 607 notify_externally_resized 608 (<a href = "#size_type3735929547">size_type</a> new_size)</pre> 609 610 611</td> 612 613<td> 614<p>Notifies the table was resized externally.</p> 615 616 617</td> 618 619</tr> 620 621</table> 622 623<h2> 624<a name = "link10">Queries. 625</a> 626 627</h2> 628 629<p>Called to query whether/how to resize.</p> 630 631 632<table WIDTH = "100%" BORDER = "1"> 633<TR><TD Width = "45%" ALIGN = "left"><b>Method</b></TD><TD Width = "55%" ALIGN = "left"><b>Description</b></TD></TR> 634 635 636<tr> 637<td> 638<pre><b>inline</b> <b>bool</b> 639 is_resize_needed 640 () <b>const</b></pre> 641 642 643</td> 644 645<td> 646<p>Queries whether a resize is needed.</p> 647 648 649</td> 650 651</tr> 652 653<tr> 654<td> 655<pre><b>inline</b> <b>bool</b> 656 is_grow_needed 657 (<a href = "#size_type3735929547">size_type</a> size, <a href = "#size_type3735929547">size_type</a> num_entries) <b>const</b></pre> 658 659 660</td> 661 662<td> 663<p>Queries whether a grow is needed.</p> 664 665 666<p>This method is called only if this object indicated is needed.</p> 667 668 669</td> 670 671</tr> 672 673<tr> 674<td> 675<pre><b>inline</b> <b>bool</b> 676 is_shrink_needed 677 (<a href = "#size_type3735929547">size_type</a> size, <a href = "#size_type3735929547">size_type</a> num_entries) <b>const</b></pre> 678 679 680</td> 681 682<td> 683<p>Queries whether a shrink is needed.</p> 684 685 686<p>This method is called only if this object indicated is needed.</p> 687 688 689</td> 690 691</tr> 692 693</table> 694 695 696 697</body> 698 699</html> 700 701 702