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_max_collision_check_resize_trigger
10  Interface</title>
11  <meta http-equiv="Content-Type" content=
12  "text/html; charset=us-ascii" />
13  </head>
14
15<body>
16  <div id="page">
17    <h1><tt>cc_hash_max_collision_check_resize_trigger</tt>
18    Interface</h1>
19
20    <p>A resize trigger policy based on collision checks. It keeps
21    the simulated load factor lower than some given load
22    factor.</p>
23
24    <p>Defined in: <a href=
25    "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>
26
27    <h2><a name="link1" id="link1">Template Parameters</a></h2>
28
29    <table class="c1" width="100%" border="1" summary=
30    "Template Parameters">
31      <tr>
32        <td width="20%" align="left"><b>Parameter</b></td>
33
34        <td width="50%" align="left"><b>Description</b></td>
35
36        <td width="30%" align="left"><b>Default Value</b></td>
37      </tr>
38
39      <tr>
40        <td>
41          <pre>
42<a name="External_Load_Access1313998607" id=
43"External_Load_Access1313998607"><b>bool</b> External_Load_Access </a>
44</pre>
45        </td>
46
47        <td>
48          <p>Specifies whether the load factor can be accessed
49          externally. The two options have different trade-offs in
50          terms of flexibility, genericity, and encapsulation.</p>
51        </td>
52
53        <td><tt><b>false</b></tt></td>
54      </tr>
55
56      <tr>
57        <td>
58          <pre>
59<a name="Size_Type42920436" id=
60"Size_Type42920436"><b>typename</b> Size_Type </a>
61</pre>
62        </td>
63
64        <td>
65          <p>Size type.</p>
66        </td>
67
68        <td>size_t</td>
69      </tr>
70    </table>
71
72    <h2><a name="link2" id="link2">Public Types and
73    Constants</a></h2>
74
75    <h3><a name="link3" id="link3">General Definitions</a></h3>
76
77    <table class="c1" width="100%" border="1" summary="Types">
78      <tr>
79        <td width="30%" align="left"><b>Type</b></td>
80
81        <td width="55%" align="left"><b>Definition</b></td>
82
83        <td width="15%" align="left"><b>Description</b></td>
84      </tr>
85
86      <tr>
87        <td>
88          <pre>
89<a name="size_type55424436" id="size_type55424436">size_type</a>
90</pre>
91        </td>
92
93        <td>
94          <pre>
95<a href="#Size_Type42920436"><tt>Size_Type</tt></a>
96</pre>
97        </td>
98
99        <td>
100          <p>Size type.</p>
101        </td>
102      </tr>
103
104      <tr>
105        <td>
106          <pre>
107<a name="external_load_access3976598639" id=
108"external_load_access3976598639">external_load_access</a>
109</pre>
110        </td>
111
112        <td>
113          <pre>
114<a href=
115"#External_Load_Access1313998607"><tt>External_Load_Access</tt></a>
116</pre>
117        </td>
118
119        <td>
120          <p>Indicates whether loads can be accessed externally</p>
121        </td>
122      </tr>
123    </table>
124
125    <h2><a name="link4" id="link4">Public Methods</a></h2>
126
127    <h3><a name="link5" id="link5">Constructors, Destructor, and
128    Related</a></h3>
129
130    <table class="c1" width="100%" border="1" summary="Methods">
131      <tr>
132        <td width="45%" align="left"><b>Method</b></td>
133
134        <td width="55%" align="left"><b>Description</b></td>
135      </tr>
136
137      <tr>
138        <td>
139          <pre>
140  cc_hash_max_collision_check_resize_trigger
141  (float load = 0.5)
142</pre>
143        </td>
144
145        <td>
146          <p>Default constructor, or constructor taking
147          <span class="c1"><tt>load</tt></span>, a load factor
148          which it will attempt to maintain.</p>
149        </td>
150      </tr>
151
152      <tr>
153        <td>
154          <pre>
155<b>void</b>
156  swap
157  (<span class=
158"c2"><tt>cc_hash_max_collision_check_resize_trigger</tt></span> &amp;other)
159</pre>
160        </td>
161
162        <td>
163          <p>Swaps content.</p>
164        </td>
165      </tr>
166    </table>
167
168    <h3><a name="link6" id="link6">Load Access Methods</a></h3>
169
170    <p>These methods are only available if the external access
171    parameter is set.</p>
172
173    <table class="c1" width="100%" border="1" summary="Methods">
174      <tr>
175        <td width="45%" align="left"><b>Method</b></td>
176
177        <td width="55%" align="left"><b>Description</b></td>
178      </tr>
179
180      <tr>
181        <td>
182          <pre>
183<b>inline</b> float
184  get_load
185  () <b>const</b>
186</pre>
187        </td>
188
189        <td>
190          <p>Returns the current load.</p>
191
192          <p>Calling this method will not compile when <a href=
193          "#External_Load_Access1313998607"><tt>External_Load_Access</tt></a>
194          == <tt><b>false</b></tt>.</p>
195        </td>
196      </tr>
197
198      <tr>
199        <td>
200          <pre>
201<b>void</b> 
202  set_load
203  (float load)
204</pre>
205        </td>
206
207        <td>
208          <p>Sets the <span class="c1"><tt>load</tt></span>; does
209          not resize the container.</p>
210
211          <p>It is the responsibility of the user to pass an
212          appropriate <span class="c1"><tt>load</tt></span> to this
213          function. Calling this method will not compile when
214          <a href=
215          "#External_Load_Access1313998607"><tt>External_Load_Access</tt></a>
216          == <tt><b>false</b></tt>.</p>
217        </td>
218      </tr>
219    </table>
220
221    <h2><a name="link7" id="link7">Protected Methods</a></h2>
222
223    <h3><a name="link8" id="link8">Insert Search
224    Notifications.</a></h3>
225
226    <p>Notifications called during an insert operation.</p>
227
228    <table class="c1" width="100%" border="1" summary="Methods">
229      <tr>
230        <td width="45%" align="left"><b>Method</b></td>
231
232        <td width="55%" align="left"><b>Description</b></td>
233      </tr>
234
235      <tr>
236        <td>
237          <pre>
238<b>inline</b> <b>void</b>
239  notify_insert_search_start
240  ()
241</pre>
242        </td>
243
244        <td>
245          <p>Notifies a search started.</p>
246        </td>
247      </tr>
248
249      <tr>
250        <td>
251          <pre>
252<b>inline</b> <b>void</b>
253  notify_insert_search_collision
254  ()
255</pre>
256        </td>
257
258        <td>
259          <p>Notifies a search encountered a collision.</p>
260        </td>
261      </tr>
262
263      <tr>
264        <td>
265          <pre>
266<b>inline</b> <b>void</b>
267  notify_insert_search_end
268  ()
269</pre>
270        </td>
271
272        <td>
273          <p>Notifies a search ended.</p>
274        </td>
275      </tr>
276    </table>
277
278    <h3><a name="link9" id="link9">Find Search
279    Notifications.</a></h3>
280
281    <p>Notifications called during a find operation.</p>
282
283    <table class="c1" width="100%" border="1" summary="Methods">
284      <tr>
285        <td width="45%" align="left"><b>Method</b></td>
286
287        <td width="55%" align="left"><b>Description</b></td>
288      </tr>
289
290      <tr>
291        <td>
292          <pre>
293<b>inline</b> <b>void</b>
294  notify_find_search_start
295  ()
296</pre>
297        </td>
298
299        <td>
300          <p>Notifies a search started.</p>
301        </td>
302      </tr>
303
304      <tr>
305        <td>
306          <pre>
307<b>inline</b> <b>void</b>
308  notify_find_search_collision
309  ()
310</pre>
311        </td>
312
313        <td>
314          <p>Notifies a search encountered a collision.</p>
315        </td>
316      </tr>
317
318      <tr>
319        <td>
320          <pre>
321<b>inline</b> <b>void</b>
322  notify_find_search_end
323  ()
324</pre>
325        </td>
326
327        <td>
328          <p>Notifies a search ended.</p>
329        </td>
330      </tr>
331    </table>
332
333    <h3><a name="link10" id="link10">Erase Search
334    Notifications.</a></h3>
335
336    <p>Notifications called during an insert operation.</p>
337
338    <table class="c1" width="100%" border="1" summary="Methods">
339      <tr>
340        <td width="45%" align="left"><b>Method</b></td>
341
342        <td width="55%" align="left"><b>Description</b></td>
343      </tr>
344
345      <tr>
346        <td>
347          <pre>
348<b>inline</b> <b>void</b>
349  notify_erase_search_start
350  ()
351</pre>
352        </td>
353
354        <td>
355          <p>Notifies a search started.</p>
356        </td>
357      </tr>
358
359      <tr>
360        <td>
361          <pre>
362<b>inline</b> <b>void</b>
363  notify_erase_search_collision
364  ()
365</pre>
366        </td>
367
368        <td>
369          <p>Notifies a search encountered a collision.</p>
370        </td>
371      </tr>
372
373      <tr>
374        <td>
375          <pre>
376<b>inline</b> <b>void</b>
377  notify_erase_search_end
378  ()
379</pre>
380        </td>
381
382        <td>
383          <p>Notifies a search ended.</p>
384        </td>
385      </tr>
386    </table>
387
388    <h3><a name="link11" id="link11">Content Change
389    Notifications</a></h3>
390
391    <p>Notifications called when the content of the table changes
392    in a way that can affect the resize policy.</p>
393
394    <table class="c1" width="100%" border="1" summary="Methods">
395      <tr>
396        <td width="45%" align="left"><b>Method</b></td>
397
398        <td width="55%" align="left"><b>Description</b></td>
399      </tr>
400
401      <tr>
402        <td>
403          <pre>
404<b>inline</b> <b>void</b>
405  notify_inserted
406  (<a href="#size_type55424436"><tt>size_type</tt></a> num_entries)
407</pre>
408        </td>
409
410        <td>
411          <p>Notifies an element was inserted.</p>
412        </td>
413      </tr>
414
415      <tr>
416        <td>
417          <pre>
418<b>inline</b> <b>void</b>
419  notify_erased
420  (<a href="#size_type55424436"><tt>size_type</tt></a> num_entries)
421</pre>
422        </td>
423
424        <td>
425          <p>Notifies an element was erased.</p>
426        </td>
427      </tr>
428
429      <tr>
430        <td>
431          <pre>
432<b>void</b> 
433  notify_cleared
434  ()
435</pre>
436        </td>
437
438        <td>
439          <p>Notifies the table was cleared.</p>
440        </td>
441      </tr>
442    </table>
443
444    <h3><a name="link12" id="link12">Size Change
445    Notifications</a></h3>
446
447    <p>Notifications called when the table changes size.</p>
448
449    <table class="c1" width="100%" border="1" summary="Methods">
450      <tr>
451        <td width="45%" align="left"><b>Method</b></td>
452
453        <td width="55%" align="left"><b>Description</b></td>
454      </tr>
455
456      <tr>
457        <td>
458          <pre>
459<b>void</b>
460  notify_resized
461  (<a href="#size_type55424436"><tt>size_type</tt></a> new_size)
462</pre>
463        </td>
464
465        <td>
466          <p>Notifies the table was resized as a result of this
467          object's signifying that a resize is needed.</p>
468        </td>
469      </tr>
470
471      <tr>
472        <td>
473          <pre>
474<b>void</b>
475  notify_externally_resized
476  (<a href="#size_type55424436"><tt>size_type</tt></a> new_size)
477</pre>
478        </td>
479
480        <td>
481          <p>Notifies the table was resized externally.</p>
482        </td>
483      </tr>
484    </table>
485
486    <h3><a name="link13" id="link13">Queries</a></h3>
487
488    <p>Called to query whether/how to resize.</p>
489
490    <table class="c1" width="100%" border="1" summary="Methods">
491      <tr>
492        <td width="45%" align="left"><b>Method</b></td>
493
494        <td width="55%" align="left"><b>Description</b></td>
495      </tr>
496
497      <tr>
498        <td>
499          <pre>
500<b>inline</b> <b>bool</b> 
501  is_resize_needed
502  () <b>const</b>
503</pre>
504        </td>
505
506        <td>
507          <p>Queries whether a resize is needed.</p>
508        </td>
509      </tr>
510
511      <tr>
512        <td>
513          <pre>
514<b>inline</b> <b>bool</b>
515  is_grow_needed
516  (<a href=
517"#size_type55424436"><tt>size_type</tt></a> size, <a href=
518"#size_type55424436"><tt>size_type</tt></a> num_entries) <b>const</b>
519</pre>
520        </td>
521
522        <td>
523          <p>Queries whether a grow is needed.</p>
524
525          <p>This method is called only if this object indicated is
526          needed.</p>
527        </td>
528      </tr>
529    </table>
530  </div>
531</body>
532</html>
533