OpenCores
URL https://opencores.org/ocsvn/scarts/scarts/trunk

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-gcc/] [gcc-4.1.1/] [libstdc++-v3/] [docs/] [html/] [ext/] [pb_assoc/] [hash_load_check_resize_trigger.html] - Blame information for rev 20

Details | Compare with Previous | View Log

Line No. Rev Author Line
1 20 jlechner
 
2
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
3
 
4
 
5
<html>
6
<head>
7
<title>hash_load_check_resize_trigger Interface
8
</title>
9
 
10
</head>
11
 
12
<body>
13
<h1>
14
<tt>hash_load_check_resize_trigger
15
</tt>
16
 
17
 Interface
18
 
19
 
20
</h1>
21
 
22
<p>A resize trigger policy based on a load check. It keeps the load factor between some load factors load_min and load_max.
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>
39
Public 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>
54
Public 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>
75
Protected 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>
167
size_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>  hash_load_check_resize_trigger
243
  (float load_min = 0.125,
244
    float load_max = 0.5)</pre>
245
 
246
 
247
</td>
248
 
249
<td>
250
<p>Default constructor, or constructor taking <font color = "#666666"><tt>load_min</tt></font> and <font color = "#666666"><tt>load_max</tt></font> load factors between which this policy will keep the actual load.</p>
251
 
252
 
253
<p>It is the responsibility of the user to ensure that <font color = "#666666"><tt>load_min</tt></font> is smaller than <font color = "#666666"><tt>load_max</tt></font>.</p>
254
 
255
 
256
</td>
257
 
258
</tr>
259
 
260
<tr>
261
<td>
262
<pre><b>void</b>
263
  swap
264
  (<font color = "olive">hash_load_check_resize_trigger</font> &amp;r_other)</pre>
265
 
266
 
267
</td>
268
 
269
<td>
270
<p>Swaps content.</p>
271
 
272
 
273
</td>
274
 
275
</tr>
276
 
277
<tr>
278
<td>
279
<pre>  <b>virtual</b>
280
    ~hash_load_check_resize_trigger
281
    ()</pre>
282
 
283
 
284
</td>
285
 
286
<td>
287
<p>Destructor.</p>
288
 
289
 
290
</td>
291
 
292
</tr>
293
 
294
</table>
295
 
296
<h2>
297
<a name = "link4">Load access methods.
298
</a>
299
 
300
</h2>
301
 
302
<p> These methods are only available if the external access parameter is set.</p>
303
 
304
 
305
<table WIDTH = "100%" BORDER = "1">
306
<TR><TD Width = "45%" ALIGN = "left"><b>Method</b></TD><TD Width = "55%" ALIGN = "left"><b>Description</b></TD></TR>
307
 
308
 
309
<tr>
310
<td>
311
<pre><b>inline</b> std::pair&lt;float, float&gt;
312
  get_loads
313
  () <b>const</b></pre>
314
 
315
 
316
</td>
317
 
318
<td>
319
<p>Returns a pair of the minimal and maximal loads, respectively.</p>
320
 
321
 
322
<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>
323
 
324
 
325
</td>
326
 
327
</tr>
328
 
329
<tr>
330
<td>
331
<pre><b>void</b>
332
  set_loads
333
  (std::pair&lt;float, float&gt; load_pair)</pre>
334
 
335
 
336
</td>
337
 
338
<td>
339
<p>Sets the loads through a pair of the minimal and maximal loads, respectively.</p>
340
 
341
 
342
<p>Calling this method resizes the container, and might throw an exception. It is the responsibility of the user to pass appropriate loads to this function. Calling this method will not compile when <a href = "#External_Load_Access3735929540"><tt>External_Load_Access</tt></a> == <tt><b>false</b></tt>.</p>
343
 
344
 
345
</td>
346
 
347
</tr>
348
 
349
</table>
350
 
351
<h2>
352
<a name = "link5">Insert search notifications.
353
</a>
354
 
355
</h2>
356
 
357
<p>Notifications called during an insert operation.</p>
358
 
359
 
360
<table WIDTH = "100%" BORDER = "1">
361
<TR><TD Width = "45%" ALIGN = "left"><b>Method</b></TD><TD Width = "55%" ALIGN = "left"><b>Description</b></TD></TR>
362
 
363
 
364
<tr>
365
<td>
366
<pre><b>inline</b> <b>void</b>
367
  notify_insert_search_start
368
  ()</pre>
369
 
370
 
371
</td>
372
 
373
<td>
374
<p>Notifies a search started.</p>
375
 
376
 
377
</td>
378
 
379
</tr>
380
 
381
<tr>
382
<td>
383
<pre><b>inline</b> <b>void</b>
384
  notify_insert_search_collision
385
  ()</pre>
386
 
387
 
388
</td>
389
 
390
<td>
391
<p>Notifies a search encountered a collision.</p>
392
 
393
 
394
</td>
395
 
396
</tr>
397
 
398
<tr>
399
<td>
400
<pre><b>inline</b> <b>void</b>
401
  notify_insert_search_end
402
  ()</pre>
403
 
404
 
405
</td>
406
 
407
<td>
408
<p>Notifies a search ended.</p>
409
 
410
 
411
</td>
412
 
413
</tr>
414
 
415
</table>
416
 
417
<h2>
418
<a name = "link6">Find search notifications.
419
</a>
420
 
421
</h2>
422
 
423
<p>Notifications called during a find operation.</p>
424
 
425
 
426
<table WIDTH = "100%" BORDER = "1">
427
<TR><TD Width = "45%" ALIGN = "left"><b>Method</b></TD><TD Width = "55%" ALIGN = "left"><b>Description</b></TD></TR>
428
 
429
 
430
<tr>
431
<td>
432
<pre><b>inline</b> <b>void</b>
433
  notify_find_search_start
434
  ()</pre>
435
 
436
 
437
</td>
438
 
439
<td>
440
<p>Notifies a search started.</p>
441
 
442
 
443
</td>
444
 
445
</tr>
446
 
447
<tr>
448
<td>
449
<pre><b>inline</b> <b>void</b>
450
  notify_find_search_collision
451
  ()</pre>
452
 
453
 
454
</td>
455
 
456
<td>
457
<p>Notifies a search encountered a collision.</p>
458
 
459
 
460
</td>
461
 
462
</tr>
463
 
464
<tr>
465
<td>
466
<pre><b>inline</b> <b>void</b>
467
  notify_find_search_end
468
  ()</pre>
469
 
470
 
471
</td>
472
 
473
<td>
474
<p>Notifies a search ended.</p>
475
 
476
 
477
</td>
478
 
479
</tr>
480
 
481
</table>
482
 
483
<h2>
484
<a name = "link7">Erase search notifications.
485
</a>
486
 
487
</h2>
488
 
489
<p>Notifications called during an insert operation.</p>
490
 
491
 
492
<table WIDTH = "100%" BORDER = "1">
493
<TR><TD Width = "45%" ALIGN = "left"><b>Method</b></TD><TD Width = "55%" ALIGN = "left"><b>Description</b></TD></TR>
494
 
495
 
496
<tr>
497
<td>
498
<pre><b>inline</b> <b>void</b>
499
  notify_erase_search_start
500
  ()</pre>
501
 
502
 
503
</td>
504
 
505
<td>
506
<p>Notifies a search started.</p>
507
 
508
 
509
</td>
510
 
511
</tr>
512
 
513
<tr>
514
<td>
515
<pre><b>inline</b> <b>void</b>
516
  notify_erase_search_collision
517
  ()</pre>
518
 
519
 
520
</td>
521
 
522
<td>
523
<p>Notifies a search encountered a collision.</p>
524
 
525
 
526
</td>
527
 
528
</tr>
529
 
530
<tr>
531
<td>
532
<pre><b>inline</b> <b>void</b>
533
  notify_erase_search_end
534
  ()</pre>
535
 
536
 
537
</td>
538
 
539
<td>
540
<p>Notifies a search ended.</p>
541
 
542
 
543
</td>
544
 
545
</tr>
546
 
547
</table>
548
 
549
<h2>
550
<a name = "link8">Content change notifications.
551
</a>
552
 
553
</h2>
554
 
555
<p>Notifications called when the content of the table changes in a way that can affect the resize policy.</p>
556
 
557
 
558
<table WIDTH = "100%" BORDER = "1">
559
<TR><TD Width = "45%" ALIGN = "left"><b>Method</b></TD><TD Width = "55%" ALIGN = "left"><b>Description</b></TD></TR>
560
 
561
 
562
<tr>
563
<td>
564
<pre><b>inline</b> <b>void</b>
565
  notify_inserted
566
  (<a href = "#size_type3735929547">size_type</a> num_entries)</pre>
567
 
568
 
569
</td>
570
 
571
<td>
572
<p>Notifies an element was inserted. the total number of entries in the table is <font color = "#666666"><tt>num_entries</tt></font>.</p>
573
 
574
 
575
</td>
576
 
577
</tr>
578
 
579
<tr>
580
<td>
581
<pre><b>inline</b> <b>void</b>
582
  notify_erased
583
  (<a href = "#size_type3735929547">size_type</a> num_entries)</pre>
584
 
585
 
586
</td>
587
 
588
<td>
589
<p>Notifies an element was erased.</p>
590
 
591
 
592
</td>
593
 
594
</tr>
595
 
596
<tr>
597
<td>
598
<pre><b>void</b>
599
  notify_cleared
600
  ()</pre>
601
 
602
 
603
</td>
604
 
605
<td>
606
<p>Notifies the table was cleared.</p>
607
 
608
 
609
</td>
610
 
611
</tr>
612
 
613
</table>
614
 
615
<h2>
616
<a name = "link9">Size change notifications.
617
</a>
618
 
619
</h2>
620
 
621
<p>Notifications called when the table changes size.</p>
622
 
623
 
624
<table WIDTH = "100%" BORDER = "1">
625
<TR><TD Width = "45%" ALIGN = "left"><b>Method</b></TD><TD Width = "55%" ALIGN = "left"><b>Description</b></TD></TR>
626
 
627
 
628
<tr>
629
<td>
630
<pre><b>void</b>
631
  notify_resized
632
  (<a href = "#size_type3735929547">size_type</a> new_size)</pre>
633
 
634
 
635
</td>
636
 
637
<td>
638
<p>Notifies the table was resized as a result of this object's signifying that a resize is needed.</p>
639
 
640
 
641
</td>
642
 
643
</tr>
644
 
645
<tr>
646
<td>
647
<pre><b>void</b>
648
  notify_externally_resized
649
  (<a href = "#size_type3735929547">size_type</a> new_size)</pre>
650
 
651
 
652
</td>
653
 
654
<td>
655
<p>Notifies the table was resized externally.</p>
656
 
657
 
658
</td>
659
 
660
</tr>
661
 
662
</table>
663
 
664
<h2>
665
<a name = "link10">Queries.
666
</a>
667
 
668
</h2>
669
 
670
<p>Called to query whether/how to resize.</p>
671
 
672
 
673
<table WIDTH = "100%" BORDER = "1">
674
<TR><TD Width = "45%" ALIGN = "left"><b>Method</b></TD><TD Width = "55%" ALIGN = "left"><b>Description</b></TD></TR>
675
 
676
 
677
<tr>
678
<td>
679
<pre><b>inline</b> <b>bool</b>
680
  is_resize_needed
681
  () <b>const</b></pre>
682
 
683
 
684
</td>
685
 
686
<td>
687
<p>Queries whether a resize is needed.</p>
688
 
689
 
690
</td>
691
 
692
</tr>
693
 
694
<tr>
695
<td>
696
<pre><b>inline</b> <b>bool</b>
697
  is_grow_needed
698
  (<a href = "#size_type3735929547">size_type</a> size,
699
    <a href = "#size_type3735929547">size_type</a> num_entries) <b>const</b></pre>
700
 
701
 
702
</td>
703
 
704
<td>
705
<p>Queries whether a grow is needed.</p>
706
 
707
 
708
<p>This method is called only if this object indicated resize is needed. The actual <font color = "#666666"><tt>size</tt></font> of the table is <font color = "#666666"><tt>size</tt></font>, and the number of entries in it is <font color = "#666666"><tt>num_entries</tt></font>.</p>
709
 
710
 
711
</td>
712
 
713
</tr>
714
 
715
<tr>
716
<td>
717
<pre><b>inline</b> <b>bool</b>
718
  is_shrink_needed
719
  (<a href = "#size_type3735929547">size_type</a> size,
720
    <a href = "#size_type3735929547">size_type</a> num_entries) <b>const</b></pre>
721
 
722
 
723
</td>
724
 
725
<td>
726
<p>Queries whether a shrink is needed.</p>
727
 
728
 
729
<p>This method is called only if this object indicated resize is needed. The actual <font color = "#666666"><tt>size</tt></font> of the table is <font color = "#666666"><tt>size</tt></font>, and the number of entries in it is <font color = "#666666"><tt>num_entries</tt></font>.</p>
730
 
731
 
732
</td>
733
 
734
</tr>
735
 
736
</table>
737
 
738
 
739
 
740
</body>
741
 
742
</html>
743
 
744
 

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.