Remove old autovect-branch by moving to "dead" directory.
[official-gcc.git] / old-autovect-branch / libstdc++-v3 / docs / html / ext / pb_assoc / hash_load_check_resize_trigger.html
blob6670d696860415904150df30c4a37205142a5a5c
2 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
5 <html>
6 <head>
7 <title>hash_load_check_resize_trigger Interface
8 </title>
10 </head>
12 <body>
13 <h1>
14 <tt>hash_load_check_resize_trigger
15 </tt>
17 Interface
20 </h1>
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>
25 <ol>
26 <li>
27 <a href = "../../../../include/ext/pb_assoc/hash_policy.hpp"><tt>hash_policy.hpp</tt>
28 </a>
30 </li>
32 <li>
33 <a href = "#link1">Template parameters.
34 </a>
36 </li>
38 <li>
39 Public Types and Constants:
42 <ol>
43 <li>
44 <a href = "#link2">General definitions.
45 </a>
47 </li>
49 </ol>
51 </li>
53 <li>
54 Public Methods:
57 <ol>
58 <li>
59 <a href = "#link3">Constructors, destructor, and related.
60 </a>
62 </li>
64 <li>
65 <a href = "#link4">Load access methods.
66 </a>
68 </li>
70 </ol>
72 </li>
74 <li>
75 Protected Methods:
78 <ol>
79 <li>
80 <a href = "#link5">Insert search notifications.
81 </a>
83 </li>
85 <li>
86 <a href = "#link6">Find search notifications.
87 </a>
89 </li>
91 <li>
92 <a href = "#link7">Erase search notifications.
93 </a>
95 </li>
97 <li>
98 <a href = "#link8">Content change notifications.
99 </a>
101 </li>
103 <li>
104 <a href = "#link9">Size change notifications.
105 </a>
107 </li>
109 <li>
110 <a href = "#link10">Queries.
111 </a>
113 </li>
115 </ol>
117 </li>
119 </ol>
122 <h2>
123 <a name = "link1">Template parameters.
124 </a>
126 </h2>
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>
132 <tr>
133 <td>
134 <pre><a name = "External_Load_Access3735929540">External_Load_Access</a></pre>
137 </td>
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>
143 </td>
145 <td>
146 <tt><b>false</b></tt>
149 </td>
151 </tr>
153 <tr>
154 <td>
155 <pre><a name = "Size_Type3735929483">Size_Type</a></pre>
158 </td>
160 <td>
161 <p>Size type.</p>
164 </td>
166 <td>
167 size_t
170 </td>
172 </tr>
174 </table>
176 <h2>
177 <a name = "link2">General definitions.
178 </a>
180 </h2>
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>
186 <tr>
187 <td>
188 <pre><a name = "size_type3735929547">size_type</a></pre>
191 </td>
193 <td>
194 <pre><a href = "#Size_Type3735929483">Size_Type</a></pre>
197 </td>
199 <td>
200 <p>Size type.</p>
203 </td>
205 </tr>
207 <tr>
208 <td>
209 <pre><a name = "external_load_access3735929604">external_load_access</a></pre>
212 </td>
214 <td>
215 <pre><a href = "#External_Load_Access3735929540">External_Load_Access</a></pre>
218 </td>
220 <td>
221 <p>Indicates whether loads can be accessed externally</p>
224 </td>
226 </tr>
228 </table>
230 <h2>
231 <a name = "link3">Constructors, destructor, and related.
232 </a>
234 </h2>
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>
240 <tr>
241 <td>
242 <pre> hash_load_check_resize_trigger
243 (float load_min = 0.125,
244 float load_max = 0.5)</pre>
247 </td>
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>
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>
256 </td>
258 </tr>
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>
267 </td>
269 <td>
270 <p>Swaps content.</p>
273 </td>
275 </tr>
277 <tr>
278 <td>
279 <pre> <b>virtual</b>
280 ~hash_load_check_resize_trigger
281 ()</pre>
284 </td>
286 <td>
287 <p>Destructor.</p>
290 </td>
292 </tr>
294 </table>
296 <h2>
297 <a name = "link4">Load access methods.
298 </a>
300 </h2>
302 <p> These methods are only available if the external access parameter is set.</p>
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>
309 <tr>
310 <td>
311 <pre><b>inline</b> std::pair&lt;float, float&gt;
312 get_loads
313 () <b>const</b></pre>
316 </td>
318 <td>
319 <p>Returns a pair of the minimal and maximal loads, respectively.</p>
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>
325 </td>
327 </tr>
329 <tr>
330 <td>
331 <pre><b>void</b>
332 set_loads
333 (std::pair&lt;float, float&gt; load_pair)</pre>
336 </td>
338 <td>
339 <p>Sets the loads through a pair of the minimal and maximal loads, respectively.</p>
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>
345 </td>
347 </tr>
349 </table>
351 <h2>
352 <a name = "link5">Insert search notifications.
353 </a>
355 </h2>
357 <p>Notifications called during an insert operation.</p>
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>
364 <tr>
365 <td>
366 <pre><b>inline</b> <b>void</b>
367 notify_insert_search_start
368 ()</pre>
371 </td>
373 <td>
374 <p>Notifies a search started.</p>
377 </td>
379 </tr>
381 <tr>
382 <td>
383 <pre><b>inline</b> <b>void</b>
384 notify_insert_search_collision
385 ()</pre>
388 </td>
390 <td>
391 <p>Notifies a search encountered a collision.</p>
394 </td>
396 </tr>
398 <tr>
399 <td>
400 <pre><b>inline</b> <b>void</b>
401 notify_insert_search_end
402 ()</pre>
405 </td>
407 <td>
408 <p>Notifies a search ended.</p>
411 </td>
413 </tr>
415 </table>
417 <h2>
418 <a name = "link6">Find search notifications.
419 </a>
421 </h2>
423 <p>Notifications called during a find operation.</p>
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>
430 <tr>
431 <td>
432 <pre><b>inline</b> <b>void</b>
433 notify_find_search_start
434 ()</pre>
437 </td>
439 <td>
440 <p>Notifies a search started.</p>
443 </td>
445 </tr>
447 <tr>
448 <td>
449 <pre><b>inline</b> <b>void</b>
450 notify_find_search_collision
451 ()</pre>
454 </td>
456 <td>
457 <p>Notifies a search encountered a collision.</p>
460 </td>
462 </tr>
464 <tr>
465 <td>
466 <pre><b>inline</b> <b>void</b>
467 notify_find_search_end
468 ()</pre>
471 </td>
473 <td>
474 <p>Notifies a search ended.</p>
477 </td>
479 </tr>
481 </table>
483 <h2>
484 <a name = "link7">Erase search notifications.
485 </a>
487 </h2>
489 <p>Notifications called during an insert operation.</p>
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>
496 <tr>
497 <td>
498 <pre><b>inline</b> <b>void</b>
499 notify_erase_search_start
500 ()</pre>
503 </td>
505 <td>
506 <p>Notifies a search started.</p>
509 </td>
511 </tr>
513 <tr>
514 <td>
515 <pre><b>inline</b> <b>void</b>
516 notify_erase_search_collision
517 ()</pre>
520 </td>
522 <td>
523 <p>Notifies a search encountered a collision.</p>
526 </td>
528 </tr>
530 <tr>
531 <td>
532 <pre><b>inline</b> <b>void</b>
533 notify_erase_search_end
534 ()</pre>
537 </td>
539 <td>
540 <p>Notifies a search ended.</p>
543 </td>
545 </tr>
547 </table>
549 <h2>
550 <a name = "link8">Content change notifications.
551 </a>
553 </h2>
555 <p>Notifications called when the content of the table changes in a way that can affect the resize policy.</p>
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>
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>
569 </td>
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>
575 </td>
577 </tr>
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>
586 </td>
588 <td>
589 <p>Notifies an element was erased.</p>
592 </td>
594 </tr>
596 <tr>
597 <td>
598 <pre><b>void</b>
599 notify_cleared
600 ()</pre>
603 </td>
605 <td>
606 <p>Notifies the table was cleared.</p>
609 </td>
611 </tr>
613 </table>
615 <h2>
616 <a name = "link9">Size change notifications.
617 </a>
619 </h2>
621 <p>Notifications called when the table changes size.</p>
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>
628 <tr>
629 <td>
630 <pre><b>void</b>
631 notify_resized
632 (<a href = "#size_type3735929547">size_type</a> new_size)</pre>
635 </td>
637 <td>
638 <p>Notifies the table was resized as a result of this object's signifying that a resize is needed.</p>
641 </td>
643 </tr>
645 <tr>
646 <td>
647 <pre><b>void</b>
648 notify_externally_resized
649 (<a href = "#size_type3735929547">size_type</a> new_size)</pre>
652 </td>
654 <td>
655 <p>Notifies the table was resized externally.</p>
658 </td>
660 </tr>
662 </table>
664 <h2>
665 <a name = "link10">Queries.
666 </a>
668 </h2>
670 <p>Called to query whether/how to resize.</p>
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>
677 <tr>
678 <td>
679 <pre><b>inline</b> <b>bool</b>
680 is_resize_needed
681 () <b>const</b></pre>
684 </td>
686 <td>
687 <p>Queries whether a resize is needed.</p>
690 </td>
692 </tr>
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>
702 </td>
704 <td>
705 <p>Queries whether a grow is needed.</p>
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>
711 </td>
713 </tr>
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>
723 </td>
725 <td>
726 <p>Queries whether a shrink is needed.</p>
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>
732 </td>
734 </tr>
736 </table>
740 </body>
742 </html>