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>hash_load_check_resize_trigger Interface</title>
10 <meta http-equiv="Content-Type" content=
11 "text/html; charset=us-ascii" />
16 <h1><tt>hash_load_check_resize_trigger</tt> Interface</h1>
18 <p>A resize trigger policy based on a load check. It keeps the
19 load factor between some load factors load_min and
22 <p>Defined in: <a href=
23 "../../../../include/ext/pb_ds/hash_policy.hpp"><tt>hash_policy.hpp</tt></a></p>
25 <h2><a name="link1" id="link1">Template Parameters</a></h2>
27 <table class="c1" width="100%" border="1" summary=
28 "Template Parameters">
30 <td width="20%" align="left"><b>Parameter</b></td>
32 <td width="50%" align="left"><b>Description</b></td>
34 <td width="30%" align="left"><b>Default Value</b></td>
40 <a name="External_Load_Access1313998607" id=
41 "External_Load_Access1313998607"><b>bool</b> External_Load_Access </a>
46 <p>Specifies whether the load factor can be accessed
47 externally. The two options have different trade-offs in
48 terms of flexibility, genericity, and encapsulation.</p>
51 <td><tt><b>false</b></tt></td>
57 <a name="Size_Type42920436" id=
58 "Size_Type42920436"><b>typename</b> Size_Type </a>
70 <h2><a name="link2" id="link2">Public Types and
73 <h3><a name="link3" id="link3">General Definitions</a></h3>
75 <table class="c1" width="100%" border="1" summary="Types">
77 <td width="30%" align="left"><b>Type</b></td>
79 <td width="55%" align="left"><b>Definition</b></td>
81 <td width="15%" align="left"><b>Description</b></td>
87 <a name="size_type55424436" id="size_type55424436">size_type</a>
93 <a href="#Size_Type42920436"><tt>Size_Type</tt></a>
105 <a name="external_load_access3976598639" id=
106 "external_load_access3976598639">external_load_access</a>
113 "#External_Load_Access1313998607"><tt>External_Load_Access</tt></a>
118 <p>Indicates whether loads can be accessed externally</p>
123 <h2><a name="link4" id="link4">Public Methods</a></h2>
125 <h3><a name="link5" id="link5">Constructors, Destructor, and
128 <table class="c1" width="100%" border="1" summary="Methods">
130 <td width="45%" align="left"><b>Method</b></td>
132 <td width="55%" align="left"><b>Description</b></td>
138 hash_load_check_resize_trigger
139 (float load_min = 0.125,
140 float load_max = 0.5)
145 <p>Default constructor, or constructor taking
146 <span class="c1"><tt>load_min</tt></span> and
147 <span class="c1"><tt>load_max</tt></span> load factors
148 between which this policy will keep the actual load.</p>
150 <p>It is the responsibility of the user to ensure that
151 <span class="c1"><tt>load_min</tt></span> is smaller than
152 <span class="c1"><tt>load_max</tt></span>.</p>
162 "c2"><tt>hash_load_check_resize_trigger</tt></span> &other)
167 <p>Swaps content.</p>
175 ~hash_load_check_resize_trigger
186 <h3><a name="link6" id="link6">Load Access Methods</a></h3>
188 <p>These methods are only available if the external access
189 parameter is set.</p>
191 <table class="c1" width="100%" border="1" summary="Methods">
193 <td width="45%" align="left"><b>Method</b></td>
195 <td width="55%" align="left"><b>Description</b></td>
201 <b>inline</b> std::pair<float, float>
208 <p>Returns a pair of the minimal and maximal loads,
211 <p>Calling this method will not compile when <a href=
212 "#External_Load_Access1313998607"><tt>External_Load_Access</tt></a>
213 == <tt><b>false</b></tt>.</p>
222 (std::pair<float, float> load_pair)
227 <p>Sets the loads through a pair of the minimal and
228 maximal loads, respectively.</p>
230 <p>Calling this method resizes the container, and might
231 throw an exception. It is the responsibility of the user
232 to pass appropriate loads to this function. Calling this
233 method will not compile when <a href=
234 "#External_Load_Access1313998607"><tt>External_Load_Access</tt></a>
235 == <tt><b>false</b></tt>.</p>
240 <h2><a name="link7" id="link7">Protected Methods</a></h2>
242 <h3><a name="link8" id="link8">Insert Search
243 Notifications.</a></h3>
245 <p>Notifications called during an insert operation.</p>
247 <table class="c1" width="100%" border="1" summary="Methods">
249 <td width="45%" align="left"><b>Method</b></td>
251 <td width="55%" align="left"><b>Description</b></td>
257 <b>inline</b> <b>void</b>
258 notify_insert_search_start
264 <p>Notifies a search started.</p>
271 <b>inline</b> <b>void</b>
272 notify_insert_search_collision
278 <p>Notifies a search encountered a collision.</p>
285 <b>inline</b> <b>void</b>
286 notify_insert_search_end
292 <p>Notifies a search ended.</p>
297 <h3><a name="link9" id="link9">Find Search
298 Notifications.</a></h3>
300 <p>Notifications called during a find operation.</p>
302 <table class="c1" width="100%" border="1" summary="Methods">
304 <td width="45%" align="left"><b>Method</b></td>
306 <td width="55%" align="left"><b>Description</b></td>
312 <b>inline</b> <b>void</b>
313 notify_find_search_start
319 <p>Notifies a search started.</p>
326 <b>inline</b> <b>void</b>
327 notify_find_search_collision
333 <p>Notifies a search encountered a collision.</p>
340 <b>inline</b> <b>void</b>
341 notify_find_search_end
347 <p>Notifies a search ended.</p>
352 <h3><a name="link10" id="link10">Erase Search
353 Notifications.</a></h3>
355 <p>Notifications called during an insert operation.</p>
357 <table class="c1" width="100%" border="1" summary="Methods">
359 <td width="45%" align="left"><b>Method</b></td>
361 <td width="55%" align="left"><b>Description</b></td>
367 <b>inline</b> <b>void</b>
368 notify_erase_search_start
374 <p>Notifies a search started.</p>
381 <b>inline</b> <b>void</b>
382 notify_erase_search_collision
388 <p>Notifies a search encountered a collision.</p>
395 <b>inline</b> <b>void</b>
396 notify_erase_search_end
402 <p>Notifies a search ended.</p>
407 <h3><a name="link11" id="link11">Content Change
408 Notifications.</a></h3>
410 <p>Notifications called when the content of the table changes
411 in a way that can affect the resize policy.</p>
413 <table class="c1" width="100%" border="1" summary="Methods">
415 <td width="45%" align="left"><b>Method</b></td>
417 <td width="55%" align="left"><b>Description</b></td>
423 <b>inline</b> <b>void</b>
425 (<a href="#size_type55424436"><tt>size_type</tt></a> num_entries)
430 <p>Notifies an element was inserted. the total number of
431 entries in the table is <span class=
432 "c1"><tt>num_entries</tt></span>.</p>
439 <b>inline</b> <b>void</b>
441 (<a href="#size_type55424436"><tt>size_type</tt></a> num_entries)
446 <p>Notifies an element was erased.</p>
460 <p>Notifies the table was cleared.</p>
465 <h3><a name="link12" id="link12">Size Change
466 Notifications.</a></h3>
468 <p>Notifications called when the table changes size.</p>
470 <table class="c1" width="100%" border="1" summary="Methods">
472 <td width="45%" align="left"><b>Method</b></td>
474 <td width="55%" align="left"><b>Description</b></td>
482 (<a href="#size_type55424436"><tt>size_type</tt></a> new_size)
487 <p>Notifies the table was resized as a result of this
488 object's signifying that a resize is needed.</p>
496 notify_externally_resized
497 (<a href="#size_type55424436"><tt>size_type</tt></a> new_size)
502 <p>Notifies the table was resized externally.</p>
507 <h3><a name="link13" id="link13">Queries</a></h3>
509 <p>Called to query whether/how to resize.</p>
511 <table class="c1" width="100%" border="1" summary="Methods">
513 <td width="45%" align="left"><b>Method</b></td>
515 <td width="55%" align="left"><b>Description</b></td>
521 <b>inline</b> <b>bool</b>
528 <p>Queries whether a resize is needed.</p>
535 <b>inline</b> <b>bool</b>
537 (<a href="#size_type55424436"><tt>size_type</tt></a> size,
539 "#size_type55424436"><tt>size_type</tt></a> num_entries) <b>const</b>
544 <p>Queries whether a grow is needed.</p>
546 <p>This method is called only if this object indicated
547 resize is needed. The actual <span class=
548 "c1"><tt>size</tt></span> of the table is <span class=
549 "c1"><tt>size</tt></span>, and the number of entries in
550 it is <span class="c1"><tt>num_entries</tt></span>.</p>
555 <h2><a name="link14" id="link14">Private Methods</a></h2>
557 <h3><a name="link15" id="link15">Overrides</a></h3>
559 <table class="c1" width="100%" border="1" summary="Methods">
561 <td width="45%" align="left"><b>Method</b></td>
563 <td width="55%" align="left"><b>Description</b></td>
569 <b>virtual</b> <b>void</b>
571 (<a href="#size_type55424436"><tt>size_type</tt></a> new_size)
576 <p>Resizes to <span class=
577 "c1"><tt>new_size</tt></span>.</p>