summaryrefslogtreecommitdiff
path: root/libstdc++-v3/doc/html/ext/pb_ds/hash_standard_resize_policy.html
blob: 8dbc57ce2776c571facd739596fbea837a8cbf66 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
    "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
  <meta name="generator" content=
  "HTML Tidy for Linux/x86 (vers 12 April 2005), see www.w3.org" />

  <title>hash_standard_resize_policy Interface</title>
  <meta http-equiv="Content-Type" content=
  "text/html; charset=us-ascii" />
  </head>

<body>
  <div id="page">
    <h1><tt>hash_standard_resize_policy</tt> Interface</h1>

    <p>A resize policy which delegates operations to size and
    trigger policies.</p>

    <p>Defined in: <a href=
    "http://gcc.gnu.org/viewcvs/*checkout*/trunk/libstdc%2B%2B-v3/include/ext/pb_ds/hash_policy.hpp"><tt>hash_policy.hpp</tt></a></p>

    <h2><a name="link1" id="link1">Template Parameters</a></h2>

    <table class="c1" width="100%" border="1" summary=
    "Template Parameters">
      <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>

      <tr>
        <td>
          <pre>
<a name="Size_Policy1072992366" id=
"Size_Policy1072992366"><b>class</b> Size_Policy </a>
</pre>
        </td>

        <td>
          <p>Size policy type.</p>
        </td>

        <td><a href=
        "hash_exponential_size_policy.html"><span class="c2"><tt>hash_exponential_size_policy</tt></span></a></td>
      </tr>

      <tr>
        <td>
          <pre>
<a name="Trigger_Policy3611271815" id=
"Trigger_Policy3611271815"><b>class</b> Trigger_Policy </a>
</pre>
        </td>

        <td>
          <p>Trigger policy type.</p>
        </td>

        <td><a href=
        "hash_load_check_resize_trigger.html"><span class=
        "c2"><tt>hash_load_check_resize_trigger</tt></span></a></td>
      </tr>

      <tr>
        <td>
          <pre>
<a name="External_Size_Access1380482982" id=
"External_Size_Access1380482982"><b>bool</b> External_Size_Access </a>
</pre>
        </td>

        <td>
          <p>Indicates whether physical sizes can be accessed
          externally.</p>
        </td>

        <td><tt><b>false</b></tt></td>
      </tr>

      <tr>
        <td>
          <pre>
<a name="Size_Type42920436" id=
"Size_Type42920436"><b>typename</b> Size_Type </a>
</pre>
        </td>

        <td>
          <p>Size type.</p>
        </td>

        <td>size_t</td>
      </tr>
    </table>

    <h2><a name="link2" id="link2">Base Classes</a></h2>

    <table class="c1" width="100%" border="1" summary="Bases">
      <tr>
        <td width="80%" align="left"><b>Class</b></td>

        <td width="20%" align="left"><b>Derivation Type</b></td>
      </tr>

      <tr>
        <td>
          <pre>
<a href="#Size_Policy1072992366"><tt>Size_Policy</tt></a>
</pre>
        </td>

        <td>
          <p>public</p>
        </td>
      </tr>

      <tr>
        <td>
          <pre>
<a href="#Trigger_Policy3611271815"><tt>Trigger_Policy</tt></a>
</pre>
        </td>

        <td>
          <p>public</p>
        </td>
      </tr>
    </table>

    <h2><a name="link3" id="link3">Public Types and
    Constants</a></h2>

    <h3><a name="link4" id="link4">General Definitions</a></h3>

    <table class="c1" width="100%" border="1" summary="Types">
      <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>

      <tr>
        <td>
          <pre>
<a name="size_type55424436" id="size_type55424436">size_type</a>
</pre>
        </td>

        <td>
          <pre>
<a href="#Size_Type42920436"><tt>Size_Type</tt></a>
</pre>
        </td>

        <td>
          <p>Size type.</p>
        </td>
      </tr>
    </table>

    <h3><a name="link5" id="link5">Policy Definitions</a></h3>

    <table class="c1" width="100%" border="1" summary="Types">
      <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>

      <tr>
        <td>
          <pre>
<a name="trigger_policy4019166151" id=
"trigger_policy4019166151">trigger_policy</a>
</pre>
        </td>

        <td>
          <pre>
<a href="#Trigger_Policy3611271815"><tt>Trigger_Policy</tt></a>
</pre>
        </td>

        <td>
          <p>Trigger policy type.</p>
        </td>
      </tr>

      <tr>
        <td>
          <pre>
<a name="size_policy1385592366" id=
"size_policy1385592366">size_policy</a>
</pre>
        </td>

        <td>
          <pre>
<a href="#Size_Policy1072992366"><tt>Size_Policy</tt></a>
</pre>
        </td>

        <td>
          <p>Size policy type.</p>
        </td>
      </tr>

      <tr>
        <td>
          <pre>
<a name="external_size_access4043083014" id=
"external_size_access4043083014">external_size_access</a>
</pre>
        </td>

        <td>
          <pre>
<a href=
"#External_Size_Access1380482982"><tt>External_Size_Access</tt></a>
</pre>
        </td>

        <td>
          <p>Indicates whether sizes can be accessed
          externally.</p>
        </td>
      </tr>
    </table>

    <h2><a name="link6" id="link6">Public Methods</a></h2>

    <h3><a name="link7" id="link7">Constructors, Destructor, and
    Related</a></h3>

    <table class="c1" width="100%" border="1" summary="Methods">
      <tr>
        <td width="45%" align="left"><b>Method</b></td>

        <td width="55%" align="left"><b>Description</b></td>
      </tr>

      <tr>
        <td>
          <pre>
  hash_standard_resize_policy
  ()
</pre>
        </td>

        <td>
          <p>Default constructor.</p>
        </td>
      </tr>

      <tr>
        <td>
          <pre>
  hash_standard_resize_policy
  (<b>const</b> <a href=
"#Size_Policy1072992366"><tt>Size_Policy</tt></a> &amp;r_size_policy)
</pre>
        </td>

        <td>
          <p>constructor taking some policies <span class=
          "c1"><tt>r_size_policy</tt></span> will be copied by the
          <a href="#Size_Policy1072992366"><tt>Size_Policy</tt></a>
          object of this object.</p>
        </td>
      </tr>

      <tr>
        <td>
          <pre>
  hash_standard_resize_policy
  (<b>const</b> <a href=
"#Size_Policy1072992366"><tt>Size_Policy</tt></a> &amp;r_size_policy,
    <b>const</b> <a href=
"#Trigger_Policy3611271815"><tt>Trigger_Policy</tt></a> &amp;r_trigger_policy)
</pre>
        </td>

        <td>
          <p>constructor taking some policies. <span class=
          "c1"><tt>r_size_policy</tt></span> will be copied by the
          <a href="#Size_Policy1072992366"><tt>Size_Policy</tt></a>
          object of this object. <span class=
          "c1"><tt>r_trigger_policy</tt></span> will be copied by
          the <a href=
          "#Trigger_Policy3611271815"><tt>Trigger_Policy</tt></a>
          object of this object.</p>
        </td>
      </tr>

      <tr>
        <td>
          <pre>
<b>virtual</b> 
  ~hash_standard_resize_policy
  ()
</pre>
        </td>

        <td>
          <p>Destructor.</p>
        </td>
      </tr>

      <tr>
        <td>
          <pre>
<b>inline</b> <b>void</b> 
  swap
  (<span class=
"c2"><tt>hash_standard_resize_policy</tt></span> &amp;other)
</pre>
        </td>

        <td>
          <p>Swaps content.</p>
        </td>
      </tr>
    </table>

    <h3><a name="link8" id="link8">Policy Access Methods</a></h3>

    <table class="c1" width="100%" border="1" summary="Methods">
      <tr>
        <td width="45%" align="left"><b>Method</b></td>

        <td width="55%" align="left"><b>Description</b></td>
      </tr>

      <tr>
        <td>
          <pre>
<a href="#Size_Policy1072992366"><tt>Size_Policy</tt></a> &amp;
  get_size_policy
  ()
</pre>
        </td>

        <td>
          <p>Access to the <a href=
          "#Size_Policy1072992366"><tt>Size_Policy</tt></a> object
          used.</p>
        </td>
      </tr>

      <tr>
        <td>
          <pre>
<b>const</b> <a href=
"#Size_Policy1072992366"><tt>Size_Policy</tt></a> &amp;
  get_size_policy
  () <b>const</b>
</pre>
        </td>

        <td>
          <p>Const access to the <a href=
          "#Size_Policy1072992366"><tt>Size_Policy</tt></a> object
          used.</p>
        </td>
      </tr>

      <tr>
        <td>
          <pre>
<a href=
"#Trigger_Policy3611271815"><tt>Trigger_Policy</tt></a> &amp;
  get_trigger_policy
  ()
</pre>
        </td>

        <td>
          <p>Access to the <a href=
          "#Trigger_Policy3611271815"><tt>Trigger_Policy</tt></a>
          object used.</p>
        </td>
      </tr>

      <tr>
        <td>
          <pre>
<b>const</b> <a href=
"#Trigger_Policy3611271815"><tt>Trigger_Policy</tt></a> &amp;
  get_trigger_policy
  () <b>const</b>
</pre>
        </td>

        <td>
          <p>Access to the <a href=
          "#Trigger_Policy3611271815"><tt>Trigger_Policy</tt></a>
          object used.</p>
        </td>
      </tr>
    </table>

    <h3><a name="link9" id="link9">Size Access Methods</a></h3>

    <p>These methods are available only if the external size
    parameter indicates that external size access is allowed.</p>

    <table class="c1" width="100%" border="1" summary="Methods">
      <tr>
        <td width="45%" align="left"><b>Method</b></td>

        <td width="55%" align="left"><b>Description</b></td>
      </tr>

      <tr>
        <td>
          <pre>
<b>inline</b> <a href="#size_type55424436"><tt>size_type</tt></a> 
  get_actual_size
  () <b>const</b>
</pre>
        </td>

        <td>
          <p>Returns the actual size of the container.</p>

          <p>This method returns the number of entries (used and
          unused) in the container. It is different from the
          container's size method, which returns the number of used
          entries. Calling this method will not compile when
          <a href=
          "#External_Size_Access1380482982"><tt>External_Size_Access</tt></a>
          == <tt><b>false</b></tt>.</p>
        </td>
      </tr>

      <tr>
        <td>
          <pre>
<b>void</b> 
  resize
  (<a href=
"#size_type55424436"><tt>size_type</tt></a> suggested_new_size)
</pre>
        </td>

        <td>
          <p>Resizes the container to <span class=
          "c1"><tt>suggested_new_size</tt></span>, a suggested size
          (the actual size will be determined by the <a href=
          "#Size_Policy1072992366"><tt>Size_Policy</tt></a>
          object).</p>

          <p>Calling this method will not compile when <a href=
          "#External_Size_Access1380482982"><tt>External_Size_Access</tt></a>
          == <tt><b>false</b></tt>.</p>
        </td>
      </tr>
    </table>

    <h2><a name="link10" id="link10">Protected Methods</a></h2>

    <h3><a name="link11" id="link11">Insert Search
    Notifications.</a></h3>

    <p>Notifications called during an insert operation.</p>

    <table class="c1" width="100%" border="1" summary="Methods">
      <tr>
        <td width="45%" align="left"><b>Method</b></td>

        <td width="55%" align="left"><b>Description</b></td>
      </tr>

      <tr>
        <td>
          <pre>
<b>inline</b> <b>void</b>
  notify_insert_search_start
  ()
</pre>
        </td>

        <td>
          <p>Notifies a search started.</p>
        </td>
      </tr>

      <tr>
        <td>
          <pre>
<b>inline</b> <b>void</b>
  notify_insert_search_collision
  ()
</pre>
        </td>

        <td>
          <p>Notifies a search encountered a collision.</p>
        </td>
      </tr>

      <tr>
        <td>
          <pre>
<b>inline</b> <b>void</b>
  notify_insert_search_end
  ()
</pre>
        </td>

        <td>
          <p>Notifies a search ended.</p>
        </td>
      </tr>
    </table>

    <h3><a name="link12" id="link12">Find Search
    Notifications.</a></h3>

    <p>Notifications called during a find operation.</p>

    <table class="c1" width="100%" border="1" summary="Methods">
      <tr>
        <td width="45%" align="left"><b>Method</b></td>

        <td width="55%" align="left"><b>Description</b></td>
      </tr>

      <tr>
        <td>
          <pre>
<b>inline</b> <b>void</b>
  notify_find_search_start
  ()
</pre>
        </td>

        <td>
          <p>Notifies a search started.</p>
        </td>
      </tr>

      <tr>
        <td>
          <pre>
<b>inline</b> <b>void</b>
  notify_find_search_collision
  ()
</pre>
        </td>

        <td>
          <p>Notifies a search encountered a collision.</p>
        </td>
      </tr>

      <tr>
        <td>
          <pre>
<b>inline</b> <b>void</b>
  notify_find_search_end
  ()
</pre>
        </td>

        <td>
          <p>Notifies a search ended.</p>
        </td>
      </tr>
    </table>

    <h3><a name="link13" id="link13">Erase Search
    Notifications.</a></h3>

    <p>Notifications called during an insert operation.</p>

    <table class="c1" width="100%" border="1" summary="Methods">
      <tr>
        <td width="45%" align="left"><b>Method</b></td>

        <td width="55%" align="left"><b>Description</b></td>
      </tr>

      <tr>
        <td>
          <pre>
<b>inline</b> <b>void</b>
  notify_erase_search_start
  ()
</pre>
        </td>

        <td>
          <p>Notifies a search started.</p>
        </td>
      </tr>

      <tr>
        <td>
          <pre>
<b>inline</b> <b>void</b>
  notify_erase_search_collision
  ()
</pre>
        </td>

        <td>
          <p>Notifies a search encountered a collision.</p>
        </td>
      </tr>

      <tr>
        <td>
          <pre>
<b>inline</b> <b>void</b>
  notify_erase_search_end
  ()
</pre>
        </td>

        <td>
          <p>Notifies a search ended.</p>
        </td>
      </tr>
    </table>

    <h3><a name="link14" id="link14">Content Change
    Notifications</a></h3>

    <p>Notifications called when the content of the table changes
    in a way that can affect the resize policy.</p>

    <table class="c1" width="100%" border="1" summary="Methods">
      <tr>
        <td width="45%" align="left"><b>Method</b></td>

        <td width="55%" align="left"><b>Description</b></td>
      </tr>

      <tr>
        <td>
          <pre>
<b>inline</b> <b>void</b>
  notify_inserted
  (<a href="#size_type55424436"><tt>size_type</tt></a> num_e)
</pre>
        </td>

        <td>
          <p>Notifies an element was inserted.</p>
        </td>
      </tr>

      <tr>
        <td>
          <pre>
<b>inline</b> <b>void</b>
  notify_erased
  (<a href="#size_type55424436"><tt>size_type</tt></a> num_e)
</pre>
        </td>

        <td>
          <p>Notifies an element was erased.</p>
        </td>
      </tr>

      <tr>
        <td>
          <pre>
<b>void</b> 
  notify_cleared
  ()
</pre>
        </td>

        <td>
          <p>Notifies the table was cleared.</p>
        </td>
      </tr>
    </table>

    <h3><a name="link15" id="link15">Size Change
    Notifications</a></h3>

    <p>Notifications called when the table changes size.</p>

    <table class="c1" width="100%" border="1" summary="Methods">
      <tr>
        <td width="45%" align="left"><b>Method</b></td>

        <td width="55%" align="left"><b>Description</b></td>
      </tr>

      <tr>
        <td>
          <pre>
<b>void</b>
  notify_resized
  (<a href="#size_type55424436"><tt>size_type</tt></a> new_size)
</pre>
        </td>

        <td>
          <p>Notifies the table was resized to <span class=
          "c1"><tt>new_size</tt></span>.</p>
        </td>
      </tr>
    </table>

    <h3><a name="link16" id="link16">Queries</a></h3>

    <p>Called to query whether/how to resize.</p>

    <table class="c1" width="100%" border="1" summary="Methods">
      <tr>
        <td width="45%" align="left"><b>Method</b></td>

        <td width="55%" align="left"><b>Description</b></td>
      </tr>

      <tr>
        <td>
          <pre>
<b>inline</b> <b>bool</b>
  is_resize_needed
  () <b>const</b>
</pre>
        </td>

        <td>
          <p>Queries whether a resize is needed.</p>
        </td>
      </tr>

      <tr>
        <td>
          <pre>
<a href="#size_type55424436"><tt>size_type</tt></a>
  get_new_size
  (<a href="#size_type55424436"><tt>size_type</tt></a> size, 
    <a href=
"#size_type55424436"><tt>size_type</tt></a> num_used_e) <b>const</b>
</pre>
        </td>

        <td>
          <p>Queries what the new <span class=
          "c1"><tt>size</tt></span> should be, when the container
          is resized naturally. The current size of the container
          is <span class="c1"><tt>size</tt></span>, and the number
          of used entries within the container is <span class=
          "c1"><tt>num_used_e</tt></span>.</p>
        </td>
      </tr>
    </table>

    <h2><a name="link17" id="link17">Private Methods</a></h2>

    <h3><a name="link18" id="link18">Overrides</a></h3>

    <table class="c1" width="100%" border="1" summary="Methods">
      <tr>
        <td width="45%" align="left"><b>Method</b></td>

        <td width="55%" align="left"><b>Description</b></td>
      </tr>

      <tr>
        <td>
          <pre>
<b>virtual</b> <b>void</b>
  do_resize
  (<a href="#size_type55424436"><tt>size_type</tt></a> new_size)
</pre>
        </td>

        <td>
          <p>Resizes to <span class=
          "c1"><tt>new_size</tt></span>.</p>
        </td>
      </tr>
    </table>
  </div>
</body>
</html>