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>cc_hash_table 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>cc_hash_table</tt> Interface</h1> 17 18 <p>A concrete collision-chaining hash-based associative 19 container.</p> 20 21 <p>Defined in: <a href= 22 "http://gcc.gnu.org/viewcvs/*checkout*/trunk/libstdc%2B%2B-v3/include/ext/pb_ds/assoc_container.hpp"><tt>assoc_container.hpp</tt></a></p> 23 24 <h2><a name="link1" id="link1">Template Parameters</a></h2> 25 26 <table class="c1" width="100%" border="1" summary= 27 "Template Parameters"> 28 <tr> 29 <td width="20%" align="left"><b>Parameter</b></td> 30 31 <td width="50%" align="left"><b>Description</b></td> 32 33 <td width="30%" align="left"><b>Default Value</b></td> 34 </tr> 35 36 <tr> 37 <td> 38 <pre> 39<a name="Key2501" id="Key2501"><b>typename</b> Key</a> 40</pre> 41 </td> 42 43 <td> 44 <p>Key type.</p> 45 </td> 46 47 <td>-</td> 48 </tr> 49 50 <tr> 51 <td> 52 <pre> 53<a name="Mapped318655" id="Mapped318655"><b>typename</b> Mapped</a> 54</pre> 55 </td> 56 57 <td> 58 <p>Mapped type.</p> 59 </td> 60 61 <td>-</td> 62 </tr> 63 64 <tr> 65 <td> 66 <pre> 67<a name="Hash_Fn1515835" id= 68"Hash_Fn1515835"><b>class</b> Hash_Fn </a> 69</pre> 70 </td> 71 72 <td> 73 <p>Hash functor.</p> 74 </td> 75 76 <td> 77 <pre> 78__gnu_cxx::hash<<a href="#Key2501"><tt>Key</tt></a>> 79</pre>if using gcc; 80 <pre> 81stdext::hash_value<<a href="#Key2501"><tt>Key</tt></a>> 82</pre>if using Visual C++ .net 83 </td> 84 </tr> 85 86 <tr> 87 <td> 88 <pre> 89<a name="Eq_Fn60085" id="Eq_Fn60085"><b>class</b> Eq_Fn </a> 90</pre> 91 </td> 92 93 <td> 94 <p>Equivalence functor.</p> 95 </td> 96 97 <td> 98 <pre> 99std::equal_to<<a href="#Key2501"><tt>Key</tt></a>> 100</pre> 101 </td> 102 </tr> 103 104 <tr> 105 <td> 106 <pre> 107<a name="Comb_Hash_Fn320611039" id= 108"Comb_Hash_Fn320611039"><b>class</b> Comb_Hash_Fn </a> 109</pre> 110 </td> 111 112 <td> 113 <p>Combining hash functor.</p> 114 115 <p>If <a href="#Hash_Fn1515835"><tt>Hash_Fn</tt></a> is 116 not <a href="null_hash_fn.html"><span class= 117 "c2"><tt>null_hash_fn</tt></span></a>, then this is the 118 ranged-hash functor; otherwise, this is the range-hashing 119 functor.</p> 120 121 <p>(See <a href= 122 "hash_based_containers.html#hash_policies">Design::Hash-Based 123 Containers::Hash Policies</a>.)</p> 124 </td> 125 126 <td> 127 <pre> 128<a href="direct_mask_range_hashing.html"><span class= 129"c2"><tt>direct_mask_range_hashing</tt></span></a> 130</pre> 131 </td> 132 </tr> 133 134 <tr> 135 <td> 136 <pre> 137<a name="Resize_Policy566860465" id= 138"Resize_Policy566860465"><b>class</b> Resize_Policy </a> 139</pre> 140 </td> 141 142 <td> 143 <p>Resize policy.</p> 144 </td> 145 146 <td> 147 If <tt><a href= 148 "#Comb_Hash_Fn320611039"><tt>Comb_Hash_Fn</tt></a></tt> 149 is <tt><a href= 150 "direct_mask_range_hashing.html"><span class= 151 "c2"><tt>direct_mask_range_hashing</tt></span></a></tt>, 152 then 153 <pre> 154<a href="hash_standard_resize_policy.html"><span class= 155"c2"><tt>hash_standard_resize_policy</tt></span></a>< 156 <a href="hash_exponential_size_policy.html"><span class= 157"c2"><tt>hash_exponential_size_policy</tt></span></a>< 158 <b>typename</b> <a href= 159"#Comb_Hash_Fn320611039"><tt>Comb_Hash_Fn</tt></a>::size_type>, 160 <a href="hash_load_check_resize_trigger.html"><span class= 161"c2"><tt>hash_load_check_resize_trigger</tt></span></a>< 162 <b>typename</b> <a href= 163"#Comb_Hash_Fn320611039"><tt>Comb_Hash_Fn</tt></a>::size_type>, 164 <b>false</b>, 165 <b>typename</b> <a href= 166"#Comb_Hash_Fn320611039"><tt>Comb_Hash_Fn</tt></a>::size_type> 167</pre>otherwise, 168 <pre> 169<a href="hash_standard_resize_policy.html"><span class= 170"c2"><tt>hash_standard_resize_policy</tt></span></a>< 171 <a href="hash_exponential_size_policy.html"><span class= 172"c2"><tt>hash_exponential_size_policy</tt></span></a>< 173 <b>typename</b> <a href= 174"#Comb_Hash_Fn320611039"><tt>Comb_Hash_Fn</tt></a>::size_type>, 175 <a href="hash_load_check_resize_trigger.html"><span class= 176"c2"><tt>hash_load_check_resize_trigger</tt></span></a>< 177 <b>typename</b> <a href= 178"#Comb_Hash_Fn320611039"><tt>Comb_Hash_Fn</tt></a>::size_type>, 179 <b>false</b>, 180 <b>typename</b> <a href= 181"#Comb_Hash_Fn320611039"><tt>Comb_Hash_Fn</tt></a>::size_type> 182</pre> 183 </td> 184 </tr> 185 186 <tr> 187 <td> 188 <pre> 189<a name="Store_Hash218262104" id= 190"Store_Hash218262104"><b>bool</b> Store_Hash </a> 191</pre> 192 </td> 193 194 <td> 195 <p>Indicates whether the hash value will be stored along 196 with each key.</p> 197 198 <p>If <tt><a href= 199 "#hash_fn2015995"><tt>hash_fn</tt></a></tt> is <a href= 200 "null_hash_fn.html"><span class= 201 "c2"><tt>null_hash_fn</tt></span></a>, then the container 202 will not compile if this value is 203 <tt><b>true</b></tt></p> 204 </td> 205 206 <td> 207 <pre> 208<tt><b>false</b></tt> 209</pre> 210 </td> 211 </tr> 212 213 <tr> 214 <td> 215 <pre> 216<a name="Allocator35940069" id= 217"Allocator35940069"><b>class</b> Allocator </a> 218</pre> 219 </td> 220 221 <td> 222 <p>Allocator type.</p> 223 </td> 224 225 <td> 226 <pre> 227std::allocator<<b>char</b>> 228</pre> 229 </td> 230 </tr> 231 </table> 232 233 <h2><a name="link2" id="link2">Base Classes</a></h2> 234 235 <table class="c1" width="100%" border="1" summary="Bases"> 236 <tr> 237 <td width="80%" align="left"><b>Class</b></td> 238 239 <td width="20%" align="left"><b>Derivation Type</b></td> 240 </tr> 241 242 <tr> 243 <td> 244 <pre> 245<a href="basic_hash_table.html"><span class= 246"c2"><tt>basic_hash_table</tt></span></a> 247</pre> 248 </td> 249 250 <td> 251 <p>public</p> 252 </td> 253 </tr> 254 </table> 255 256 <h2><a name="link3" id="link3">Public Types and 257 Constants</a></h2> 258 259 <h3><a name="link4" id="link4">Policy Definitions</a></h3> 260 261 <table class="c1" width="100%" border="1" summary="Types"> 262 <tr> 263 <td width="30%" align="left"><b>Type</b></td> 264 265 <td width="55%" align="left"><b>Definition</b></td> 266 267 <td width="15%" align="left"><b>Description</b></td> 268 </tr> 269 270 <tr> 271 <td> 272 <pre> 273<a name="hash_fn2015995" id="hash_fn2015995">hash_fn</a> 274</pre> 275 </td> 276 277 <td> 278 <pre> 279<a href="#Hash_Fn1515835"><tt>Hash_Fn</tt></a> 280</pre> 281 </td> 282 283 <td> 284 <p>Hash functor type.</p> 285 </td> 286 </tr> 287 288 <tr> 289 <td> 290 <pre> 291<a name="eq_fn80245" id="eq_fn80245">eq_fn</a> 292</pre> 293 </td> 294 295 <td> 296 <pre> 297<a href="#Eq_Fn60085"><tt>Eq_Fn</tt></a> 298</pre> 299 </td> 300 301 <td> 302 <p>Equivalence functor type.</p> 303 </td> 304 </tr> 305 306 <tr> 307 <td> 308 <pre> 309<a name="resize_policy4084493169" id= 310"resize_policy4084493169">resize_policy</a> 311</pre> 312 </td> 313 314 <td> 315 <pre> 316<a href="#Resize_Policy566860465"><tt>Resize_Policy</tt></a> 317</pre> 318 </td> 319 320 <td> 321 <p>Resize policy type.</p> 322 </td> 323 </tr> 324 325 <tr> 326 <td> 327 <pre> 328<a name="comb_hash_fn1883611199" id= 329"comb_hash_fn1883611199">comb_hash_fn</a> 330</pre> 331 </td> 332 333 <td> 334 <pre> 335<a href="#Comb_Hash_Fn320611039"><tt>Comb_Hash_Fn</tt></a> 336</pre> 337 </td> 338 339 <td> 340 <p>Combining hash functor type.</p> 341 </td> 342 </tr> 343 </table> 344 345 <h2><a name="link5" id="link5">Public Methods</a></h2> 346 347 <h3><a name="link6" id="link6">Constructors, Destructor, and 348 Related</a></h3> 349 350 <table class="c1" width="100%" border="1" summary="Methods"> 351 <tr> 352 <td width="45%" align="left"><b>Method</b></td> 353 354 <td width="55%" align="left"><b>Description</b></td> 355 </tr> 356 357 <tr> 358 <td> 359 <pre> 360 cc_hash_table 361 () 362</pre> 363 </td> 364 365 <td> 366 <p>Default constructor.</p> 367 </td> 368 </tr> 369 370 <tr> 371 <td> 372 <pre> 373 cc_hash_table 374 (<b>const</b> <a href= 375"#hash_fn2015995"><tt>hash_fn</tt></a> &r_hash_fn) 376</pre> 377 </td> 378 379 <td> 380 <p>Constructor taking some policy objects. <span class= 381 "c1"><tt>r_hash_fn</tt></span> will be copied by the 382 <a href="#Hash_Fn1515835"><tt>Hash_Fn</tt></a> object of 383 the container object.</p> 384 </td> 385 </tr> 386 387 <tr> 388 <td> 389 <pre> 390 cc_hash_table 391 (<b>const</b> <a href= 392"#hash_fn2015995"><tt>hash_fn</tt></a> &r_hash_fn, 393 <b>const</b> <a href= 394"#eq_fn80245"><tt>eq_fn</tt></a> &r_eq_fn) 395</pre> 396 </td> 397 398 <td> 399 <p>Constructor taking some policy objects. <span class= 400 "c1"><tt>r_hash_fn</tt></span> will be copied by the 401 <a href="#hash_fn2015995"><tt>hash_fn</tt></a> object of 402 the container object, and <span class= 403 "c1"><tt>r_eq_fn</tt></span> will be copied by the 404 <a href="#eq_fn80245"><tt>eq_fn</tt></a> object of the 405 container object.</p> 406 </td> 407 </tr> 408 409 <tr> 410 <td> 411 <pre> 412 cc_hash_table 413 (<b>const</b> <a href= 414"#hash_fn2015995"><tt>hash_fn</tt></a> &r_hash_fn, 415 <b>const</b> <a href= 416"#eq_fn80245"><tt>eq_fn</tt></a> &r_eq_fn, 417 <b>const</b> <a href= 418"#comb_hash_fn1883611199"><tt>comb_hash_fn</tt></a> &r_comb_hash_fn) 419</pre> 420 </td> 421 422 <td> 423 <p>Constructor taking some policy objects. <span class= 424 "c1"><tt>r_hash_fn</tt></span> will be copied by the 425 <a href="#hash_fn2015995"><tt>hash_fn</tt></a> object of 426 the container object, <span class= 427 "c1"><tt>r_eq_fn</tt></span> will be copied by the 428 <a href="#eq_fn80245"><tt>eq_fn</tt></a> object of the 429 container object, and <span class= 430 "c1"><tt>r_comb_hash_fn</tt></span> will be copied by the 431 <a href= 432 "#comb_hash_fn1883611199"><tt>comb_hash_fn</tt></a> 433 object of the container object.</p> 434 </td> 435 </tr> 436 437 <tr> 438 <td> 439 <pre> 440 cc_hash_table 441 (<b>const</b> <a href= 442"#hash_fn2015995"><tt>hash_fn</tt></a> &r_hash_fn, 443 <b>const</b> <a href= 444"#eq_fn80245"><tt>eq_fn</tt></a> &r_eq_fn, 445 <b>const</b> <a href= 446"#comb_hash_fn1883611199"><tt>comb_hash_fn</tt></a> &r_comb_hash_fn, 447 <b>const</b> <a href= 448"#resize_policy4084493169"><tt>resize_policy</tt></a> &r_resize_policy) 449</pre> 450 </td> 451 452 <td> 453 <p>Constructor taking some policy objects. <span class= 454 "c1"><tt>r_hash_fn</tt></span> will be copied by the 455 <a href="#hash_fn2015995"><tt>hash_fn</tt></a> object of 456 the container object, <span class= 457 "c1"><tt>r_eq_fn</tt></span> will be copied by the 458 <a href="#eq_fn80245"><tt>eq_fn</tt></a> object of the 459 container object, <span class= 460 "c1"><tt>r_comb_hash_fn</tt></span> will be copied by the 461 <a href= 462 "#comb_hash_fn1883611199"><tt>comb_hash_fn</tt></a> 463 object of the container object, and <span class= 464 "c1"><tt>r_resize_policy</tt></span> will be copied by 465 the <a href= 466 "#resize_policy4084493169"><tt>resize_policy</tt></a> 467 object of the container object.</p> 468 </td> 469 </tr> 470 471 <tr> 472 <td> 473 <pre> 474<b>template</b>< 475 <b>class</b> It> 476 cc_hash_table 477 (It first_it, 478 It last_it) 479</pre> 480 </td> 481 482 <td> 483 <p>Constructor taking iterators to a range of 484 value_types. The value_types between <span class= 485 "c1"><tt>first_it</tt></span> and <span class= 486 "c1"><tt>last_it</tt></span> will be inserted into the 487 container object.</p> 488 </td> 489 </tr> 490 491 <tr> 492 <td> 493 <pre> 494<b>template</b>< 495 <b>class</b> It> 496 cc_hash_table 497 (It first_it, 498 It last_it, 499 <b>const</b> <a href= 500"#hash_fn2015995"><tt>hash_fn</tt></a> &r_hash_fn) 501</pre> 502 </td> 503 504 <td> 505 <p>Constructor taking iterators to a range of value_types 506 and some policy objects. The value_types between 507 <span class="c1"><tt>first_it</tt></span> and 508 <span class="c1"><tt>last_it</tt></span> will be inserted 509 into the container object.</p> 510 </td> 511 </tr> 512 513 <tr> 514 <td> 515 <pre> 516<b>template</b>< 517 <b>class</b> It> 518 cc_hash_table 519 (It first_it, 520 It last_it, 521 <b>const</b> <a href= 522"#hash_fn2015995"><tt>hash_fn</tt></a> &r_hash_fn, 523 <b>const</b> <a href= 524"#eq_fn80245"><tt>eq_fn</tt></a> &r_eq_fn) 525</pre> 526 </td> 527 528 <td> 529 <p>Constructor taking iterators to a range of value_types 530 and some policy objects The value_types between 531 <span class="c1"><tt>first_it</tt></span> and 532 <span class="c1"><tt>last_it</tt></span> will be inserted 533 into the container object. <span class= 534 "c1"><tt>r_hash_fn</tt></span> will be copied by the 535 <a href="#hash_fn2015995"><tt>hash_fn</tt></a> object of 536 the container object, and <span class= 537 "c1"><tt>r_eq_fn</tt></span> will be copied by the 538 <a href="#eq_fn80245"><tt>eq_fn</tt></a> object of the 539 container object.</p> 540 </td> 541 </tr> 542 543 <tr> 544 <td> 545 <pre> 546<b>template</b>< 547 <b>class</b> It> 548 cc_hash_table 549 (It first_it, 550 It last_it, 551 <b>const</b> <a href= 552"#hash_fn2015995"><tt>hash_fn</tt></a> &r_hash_fn, 553 <b>const</b> <a href= 554"#eq_fn80245"><tt>eq_fn</tt></a> &r_eq_fn, 555 <b>const</b> <a href= 556"#comb_hash_fn1883611199"><tt>comb_hash_fn</tt></a> &r_comb_hash_fn) 557</pre> 558 </td> 559 560 <td> 561 <p>Constructor taking iterators to a range of value_types 562 and some policy objects The value_types between 563 <span class="c1"><tt>first_it</tt></span> and 564 <span class="c1"><tt>last_it</tt></span> will be inserted 565 into the container object. <span class= 566 "c1"><tt>r_hash_fn</tt></span> will be copied by the 567 <a href="#hash_fn2015995"><tt>hash_fn</tt></a> object of 568 the container object, <span class= 569 "c1"><tt>r_eq_fn</tt></span> will be copied by the 570 <a href="#eq_fn80245"><tt>eq_fn</tt></a> object of the 571 container object, and <span class= 572 "c1"><tt>r_comb_hash_fn</tt></span> will be copied by the 573 <a href= 574 "#comb_hash_fn1883611199"><tt>comb_hash_fn</tt></a> 575 object of the container object.</p> 576 </td> 577 </tr> 578 579 <tr> 580 <td> 581 <pre> 582<b>template</b>< 583 <b>class</b> It> 584 cc_hash_table 585 (It first_it, 586 It last_it, 587 <b>const</b> <a href= 588"#hash_fn2015995"><tt>hash_fn</tt></a> &r_hash_fn, 589 <b>const</b> <a href= 590"#eq_fn80245"><tt>eq_fn</tt></a> &r_eq_fn, 591 <b>const</b> <a href= 592"#comb_hash_fn1883611199"><tt>comb_hash_fn</tt></a> &r_comb_hash_fn, 593 <b>const</b> <a href= 594"#resize_policy4084493169"><tt>resize_policy</tt></a> &r_resize_policy) 595</pre> 596 </td> 597 598 <td> 599 <p>Constructor taking iterators to a range of value_types 600 and some policy objects The value_types between 601 <span class="c1"><tt>first_it</tt></span> and 602 <span class="c1"><tt>last_it</tt></span> will be inserted 603 into the container object. <span class= 604 "c1"><tt>r_hash_fn</tt></span> will be copied by the 605 <a href="#hash_fn2015995"><tt>hash_fn</tt></a> object of 606 the container object, <span class= 607 "c1"><tt>r_eq_fn</tt></span> will be copied by the 608 <a href="#eq_fn80245"><tt>eq_fn</tt></a> object of the 609 container object, <span class= 610 "c1"><tt>r_comb_hash_fn</tt></span> will be copied by the 611 <a href= 612 "#comb_hash_fn1883611199"><tt>comb_hash_fn</tt></a> 613 object of the container object, and <span class= 614 "c1"><tt>r_resize_policy</tt></span> will be copied by 615 the <a href= 616 "#resize_policy4084493169"><tt>resize_policy</tt></a> 617 object of the container object.</p> 618 </td> 619 </tr> 620 621 <tr> 622 <td> 623 <pre> 624 cc_hash_table 625 (<b>const</b> <span class= 626"c2"><tt>cc_hash_table</tt></span> &other) 627</pre> 628 </td> 629 630 <td> 631 <p>Copy constructor.</p> 632 </td> 633 </tr> 634 635 <tr> 636 <td> 637 <pre> 638<b>virtual</b> 639 ~cc_hash_table 640 () 641</pre> 642 </td> 643 644 <td> 645 <p>Destructor.</p> 646 </td> 647 </tr> 648 649 <tr> 650 <td> 651 <pre> 652<span class="c2"><tt>cc_hash_table</tt></span> & 653 <b>operator</b>= 654 (<b>const</b> <span class= 655"c2"><tt>cc_hash_table</tt></span> &other) 656</pre> 657 </td> 658 659 <td> 660 <p>Assignment operator.</p> 661 </td> 662 </tr> 663 664 <tr> 665 <td> 666 <pre> 667<b>void</b> 668 swap 669 (<span class= 670"c2"><tt>cc_hash_table</tt></span> &other) 671</pre> 672 </td> 673 674 <td> 675 <p>Swaps content.</p> 676 </td> 677 </tr> 678 </table> 679 680 <h3><a name="link7" id="link7">Policy Access Methods</a></h3> 681 682 <table class="c1" width="100%" border="1" summary="Methods"> 683 <tr> 684 <td width="45%" align="left"><b>Method</b></td> 685 686 <td width="55%" align="left"><b>Description</b></td> 687 </tr> 688 689 <tr> 690 <td> 691 <pre> 692<a href="#comb_hash_fn1883611199"><tt>comb_hash_fn</tt></a> & 693 get_comb_hash_fn 694 () 695</pre> 696 </td> 697 698 <td> 699 <p>Access to the <a href= 700 "#comb_hash_fn1883611199"><tt>comb_hash_fn</tt></a> 701 object.</p> 702 </td> 703 </tr> 704 705 <tr> 706 <td> 707 <pre> 708<b>const</b> <a href= 709"#comb_hash_fn1883611199"><tt>comb_hash_fn</tt></a> & 710 get_comb_hash_fn 711 () <b>const</b> 712</pre> 713 </td> 714 715 <td> 716 <p>Const access to the <a href= 717 "#comb_hash_fn1883611199"><tt>comb_hash_fn</tt></a> 718 object.</p> 719 </td> 720 </tr> 721 </table> 722 </div> 723</body> 724</html> 725