1 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
2 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
6 <meta name="generator" content=
7 "HTML Tidy for Linux/x86 (vers 12 April 2005), see www.w3.org" />
9 <title>cc_hash_max_collision_check_resize_trigger
11 <meta http-equiv="Content-Type" content=
12 "text/html; charset=us-ascii" />
17 <h1><tt>cc_hash_max_collision_check_resize_trigger</tt>
20 <p>A resize trigger policy based on collision checks. It keeps
21 the simulated load factor lower than some given load
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>
27 <h2><a name="link1" id="link1">Template Parameters</a></h2>
29 <table class="c1" width="100%" border="1" summary=
30 "Template Parameters">
32 <td width="20%" align="left"><b>Parameter</b></td>
34 <td width="50%" align="left"><b>Description</b></td>
36 <td width="30%" align="left"><b>Default Value</b></td>
42 <a name="External_Load_Access1313998607" id=
43 "External_Load_Access1313998607"><b>bool</b> External_Load_Access </a>
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>
53 <td><tt><b>false</b></tt></td>
59 <a name="Size_Type42920436" id=
60 "Size_Type42920436"><b>typename</b> Size_Type </a>
72 <h2><a name="link2" id="link2">Public Types and
75 <h3><a name="link3" id="link3">General Definitions</a></h3>
77 <table class="c1" width="100%" border="1" summary="Types">
79 <td width="30%" align="left"><b>Type</b></td>
81 <td width="55%" align="left"><b>Definition</b></td>
83 <td width="15%" align="left"><b>Description</b></td>
89 <a name="size_type55424436" id="size_type55424436">size_type</a>
95 <a href="#Size_Type42920436"><tt>Size_Type</tt></a>
107 <a name="external_load_access3976598639" id=
108 "external_load_access3976598639">external_load_access</a>
115 "#External_Load_Access1313998607"><tt>External_Load_Access</tt></a>
120 <p>Indicates whether loads can be accessed externally</p>
125 <h2><a name="link4" id="link4">Public Methods</a></h2>
127 <h3><a name="link5" id="link5">Constructors, Destructor, and
130 <table class="c1" width="100%" border="1" summary="Methods">
132 <td width="45%" align="left"><b>Method</b></td>
134 <td width="55%" align="left"><b>Description</b></td>
140 cc_hash_max_collision_check_resize_trigger
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>
158 "c2"><tt>cc_hash_max_collision_check_resize_trigger</tt></span> &other)
163 <p>Swaps content.</p>
168 <h3><a name="link6" id="link6">Load Access Methods</a></h3>
170 <p>These methods are only available if the external access
171 parameter is set.</p>
173 <table class="c1" width="100%" border="1" summary="Methods">
175 <td width="45%" align="left"><b>Method</b></td>
177 <td width="55%" align="left"><b>Description</b></td>
190 <p>Returns the current load.</p>
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>
208 <p>Sets the <span class="c1"><tt>load</tt></span>; does
209 not resize the container.</p>
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
215 "#External_Load_Access1313998607"><tt>External_Load_Access</tt></a>
216 == <tt><b>false</b></tt>.</p>
221 <h2><a name="link7" id="link7">Protected Methods</a></h2>
223 <h3><a name="link8" id="link8">Insert Search
224 Notifications.</a></h3>
226 <p>Notifications called during an insert operation.</p>
228 <table class="c1" width="100%" border="1" summary="Methods">
230 <td width="45%" align="left"><b>Method</b></td>
232 <td width="55%" align="left"><b>Description</b></td>
238 <b>inline</b> <b>void</b>
239 notify_insert_search_start
245 <p>Notifies a search started.</p>
252 <b>inline</b> <b>void</b>
253 notify_insert_search_collision
259 <p>Notifies a search encountered a collision.</p>
266 <b>inline</b> <b>void</b>
267 notify_insert_search_end
273 <p>Notifies a search ended.</p>
278 <h3><a name="link9" id="link9">Find Search
279 Notifications.</a></h3>
281 <p>Notifications called during a find operation.</p>
283 <table class="c1" width="100%" border="1" summary="Methods">
285 <td width="45%" align="left"><b>Method</b></td>
287 <td width="55%" align="left"><b>Description</b></td>
293 <b>inline</b> <b>void</b>
294 notify_find_search_start
300 <p>Notifies a search started.</p>
307 <b>inline</b> <b>void</b>
308 notify_find_search_collision
314 <p>Notifies a search encountered a collision.</p>
321 <b>inline</b> <b>void</b>
322 notify_find_search_end
328 <p>Notifies a search ended.</p>
333 <h3><a name="link10" id="link10">Erase Search
334 Notifications.</a></h3>
336 <p>Notifications called during an insert operation.</p>
338 <table class="c1" width="100%" border="1" summary="Methods">
340 <td width="45%" align="left"><b>Method</b></td>
342 <td width="55%" align="left"><b>Description</b></td>
348 <b>inline</b> <b>void</b>
349 notify_erase_search_start
355 <p>Notifies a search started.</p>
362 <b>inline</b> <b>void</b>
363 notify_erase_search_collision
369 <p>Notifies a search encountered a collision.</p>
376 <b>inline</b> <b>void</b>
377 notify_erase_search_end
383 <p>Notifies a search ended.</p>
388 <h3><a name="link11" id="link11">Content Change
389 Notifications</a></h3>
391 <p>Notifications called when the content of the table changes
392 in a way that can affect the resize policy.</p>
394 <table class="c1" width="100%" border="1" summary="Methods">
396 <td width="45%" align="left"><b>Method</b></td>
398 <td width="55%" align="left"><b>Description</b></td>
404 <b>inline</b> <b>void</b>
406 (<a href="#size_type55424436"><tt>size_type</tt></a> num_entries)
411 <p>Notifies an element was inserted.</p>
418 <b>inline</b> <b>void</b>
420 (<a href="#size_type55424436"><tt>size_type</tt></a> num_entries)
425 <p>Notifies an element was erased.</p>
439 <p>Notifies the table was cleared.</p>
444 <h3><a name="link12" id="link12">Size Change
445 Notifications</a></h3>
447 <p>Notifications called when the table changes size.</p>
449 <table class="c1" width="100%" border="1" summary="Methods">
451 <td width="45%" align="left"><b>Method</b></td>
453 <td width="55%" align="left"><b>Description</b></td>
461 (<a href="#size_type55424436"><tt>size_type</tt></a> new_size)
466 <p>Notifies the table was resized as a result of this
467 object's signifying that a resize is needed.</p>
475 notify_externally_resized
476 (<a href="#size_type55424436"><tt>size_type</tt></a> new_size)
481 <p>Notifies the table was resized externally.</p>
486 <h3><a name="link13" id="link13">Queries</a></h3>
488 <p>Called to query whether/how to resize.</p>
490 <table class="c1" width="100%" border="1" summary="Methods">
492 <td width="45%" align="left"><b>Method</b></td>
494 <td width="55%" align="left"><b>Description</b></td>
500 <b>inline</b> <b>bool</b>
507 <p>Queries whether a resize is needed.</p>
514 <b>inline</b> <b>bool</b>
517 "#size_type55424436"><tt>size_type</tt></a> size, <a href=
518 "#size_type55424436"><tt>size_type</tt></a> num_entries) <b>const</b>
523 <p>Queries whether a grow is needed.</p>
525 <p>This method is called only if this object indicated is