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_standard_resize_policy Interface</title>
10 <meta http-equiv="Content-Type" content=
11 "text/html; charset=us-ascii" />
16 <h1><tt>hash_standard_resize_policy</tt> Interface</h1>
18 <p>A resize policy which delegates operations to size and
21 <p>Defined in: <a href=
22 "../../../../include/ext/pb_ds/hash_policy.hpp"><tt>hash_policy.hpp</tt></a></p>
24 <h2><a name="link1" id="link1">Template Parameters</a></h2>
26 <table class="c1" width="100%" border="1" summary=
27 "Template Parameters">
29 <td width="20%" align="left"><b>Parameter</b></td>
31 <td width="50%" align="left"><b>Description</b></td>
33 <td width="30%" align="left"><b>Default Value</b></td>
39 <a name="Size_Policy1072992366" id=
40 "Size_Policy1072992366"><b>class</b> Size_Policy </a>
45 <p>Size policy type.</p>
49 "hash_exponential_size_policy.html"><span class="c2"><tt>hash_exponential_size_policy</tt></span></a></td>
55 <a name="Trigger_Policy3611271815" id=
56 "Trigger_Policy3611271815"><b>class</b> Trigger_Policy </a>
61 <p>Trigger policy type.</p>
65 "hash_load_check_resize_trigger.html"><span class=
66 "c2"><tt>hash_load_check_resize_trigger</tt></span></a></td>
72 <a name="External_Size_Access1380482982" id=
73 "External_Size_Access1380482982"><b>bool</b> External_Size_Access </a>
78 <p>Indicates whether physical sizes can be accessed
82 <td><tt><b>false</b></tt></td>
88 <a name="Size_Type42920436" id=
89 "Size_Type42920436"><b>typename</b> Size_Type </a>
101 <h2><a name="link2" id="link2">Base Classes</a></h2>
103 <table class="c1" width="100%" border="1" summary="Bases">
105 <td width="80%" align="left"><b>Class</b></td>
107 <td width="20%" align="left"><b>Derivation Type</b></td>
113 <a href="#Size_Policy1072992366"><tt>Size_Policy</tt></a>
125 <a href="#Trigger_Policy3611271815"><tt>Trigger_Policy</tt></a>
135 <h2><a name="link3" id="link3">Public Types and
138 <h3><a name="link4" id="link4">General Definitions</a></h3>
140 <table class="c1" width="100%" border="1" summary="Types">
142 <td width="30%" align="left"><b>Type</b></td>
144 <td width="55%" align="left"><b>Definition</b></td>
146 <td width="15%" align="left"><b>Description</b></td>
152 <a name="size_type55424436" id="size_type55424436">size_type</a>
158 <a href="#Size_Type42920436"><tt>Size_Type</tt></a>
168 <h3><a name="link5" id="link5">Policy Definitions</a></h3>
170 <table class="c1" width="100%" border="1" summary="Types">
172 <td width="30%" align="left"><b>Type</b></td>
174 <td width="55%" align="left"><b>Definition</b></td>
176 <td width="15%" align="left"><b>Description</b></td>
182 <a name="trigger_policy4019166151" id=
183 "trigger_policy4019166151">trigger_policy</a>
189 <a href="#Trigger_Policy3611271815"><tt>Trigger_Policy</tt></a>
194 <p>Trigger policy type.</p>
201 <a name="size_policy1385592366" id=
202 "size_policy1385592366">size_policy</a>
208 <a href="#Size_Policy1072992366"><tt>Size_Policy</tt></a>
213 <p>Size policy type.</p>
220 <a name="external_size_access4043083014" id=
221 "external_size_access4043083014">external_size_access</a>
228 "#External_Size_Access1380482982"><tt>External_Size_Access</tt></a>
233 <p>Indicates whether sizes can be accessed
239 <h2><a name="link6" id="link6">Public Methods</a></h2>
241 <h3><a name="link7" id="link7">Constructors, Destructor, and
244 <table class="c1" width="100%" border="1" summary="Methods">
246 <td width="45%" align="left"><b>Method</b></td>
248 <td width="55%" align="left"><b>Description</b></td>
254 hash_standard_resize_policy
260 <p>Default constructor.</p>
267 hash_standard_resize_policy
268 (<b>const</b> <a href=
269 "#Size_Policy1072992366"><tt>Size_Policy</tt></a> &r_size_policy)
274 <p>constructor taking some policies <span class=
275 "c1"><tt>r_size_policy</tt></span> will be copied by the
276 <a href="#Size_Policy1072992366"><tt>Size_Policy</tt></a>
277 object of this object.</p>
284 hash_standard_resize_policy
285 (<b>const</b> <a href=
286 "#Size_Policy1072992366"><tt>Size_Policy</tt></a> &r_size_policy,
287 <b>const</b> <a href=
288 "#Trigger_Policy3611271815"><tt>Trigger_Policy</tt></a> &r_trigger_policy)
293 <p>constructor taking some policies. <span class=
294 "c1"><tt>r_size_policy</tt></span> will be copied by the
295 <a href="#Size_Policy1072992366"><tt>Size_Policy</tt></a>
296 object of this object. <span class=
297 "c1"><tt>r_trigger_policy</tt></span> will be copied by
299 "#Trigger_Policy3611271815"><tt>Trigger_Policy</tt></a>
300 object of this object.</p>
308 ~hash_standard_resize_policy
321 <b>inline</b> <b>void</b>
324 "c2"><tt>hash_standard_resize_policy</tt></span> &other)
329 <p>Swaps content.</p>
334 <h3><a name="link8" id="link8">Policy Access Methods</a></h3>
336 <table class="c1" width="100%" border="1" summary="Methods">
338 <td width="45%" align="left"><b>Method</b></td>
340 <td width="55%" align="left"><b>Description</b></td>
346 <a href="#Size_Policy1072992366"><tt>Size_Policy</tt></a> &
353 <p>Access to the <a href=
354 "#Size_Policy1072992366"><tt>Size_Policy</tt></a> object
362 <b>const</b> <a href=
363 "#Size_Policy1072992366"><tt>Size_Policy</tt></a> &
370 <p>Const access to the <a href=
371 "#Size_Policy1072992366"><tt>Size_Policy</tt></a> object
380 "#Trigger_Policy3611271815"><tt>Trigger_Policy</tt></a> &
387 <p>Access to the <a href=
388 "#Trigger_Policy3611271815"><tt>Trigger_Policy</tt></a>
396 <b>const</b> <a href=
397 "#Trigger_Policy3611271815"><tt>Trigger_Policy</tt></a> &
404 <p>Access to the <a href=
405 "#Trigger_Policy3611271815"><tt>Trigger_Policy</tt></a>
411 <h3><a name="link9" id="link9">Size Access Methods</a></h3>
413 <p>These methods are available only if the external size
414 parameter indicates that external size access is allowed.</p>
416 <table class="c1" width="100%" border="1" summary="Methods">
418 <td width="45%" align="left"><b>Method</b></td>
420 <td width="55%" align="left"><b>Description</b></td>
426 <b>inline</b> <a href="#size_type55424436"><tt>size_type</tt></a>
433 <p>Returns the actual size of the container.</p>
435 <p>This method returns the number of entries (used and
436 unused) in the container. It is different from the
437 container's size method, which returns the number of used
438 entries. Calling this method will not compile when
440 "#External_Size_Access1380482982"><tt>External_Size_Access</tt></a>
441 == <tt><b>false</b></tt>.</p>
451 "#size_type55424436"><tt>size_type</tt></a> suggested_new_size)
456 <p>Resizes the container to <span class=
457 "c1"><tt>suggested_new_size</tt></span>, a suggested size
458 (the actual size will be determined by the <a href=
459 "#Size_Policy1072992366"><tt>Size_Policy</tt></a>
462 <p>Calling this method will not compile when <a href=
463 "#External_Size_Access1380482982"><tt>External_Size_Access</tt></a>
464 == <tt><b>false</b></tt>.</p>
469 <h2><a name="link10" id="link10">Protected Methods</a></h2>
471 <h3><a name="link11" id="link11">Insert Search
472 Notifications.</a></h3>
474 <p>Notifications called during an insert operation.</p>
476 <table class="c1" width="100%" border="1" summary="Methods">
478 <td width="45%" align="left"><b>Method</b></td>
480 <td width="55%" align="left"><b>Description</b></td>
486 <b>inline</b> <b>void</b>
487 notify_insert_search_start
493 <p>Notifies a search started.</p>
500 <b>inline</b> <b>void</b>
501 notify_insert_search_collision
507 <p>Notifies a search encountered a collision.</p>
514 <b>inline</b> <b>void</b>
515 notify_insert_search_end
521 <p>Notifies a search ended.</p>
526 <h3><a name="link12" id="link12">Find Search
527 Notifications.</a></h3>
529 <p>Notifications called during a find operation.</p>
531 <table class="c1" width="100%" border="1" summary="Methods">
533 <td width="45%" align="left"><b>Method</b></td>
535 <td width="55%" align="left"><b>Description</b></td>
541 <b>inline</b> <b>void</b>
542 notify_find_search_start
548 <p>Notifies a search started.</p>
555 <b>inline</b> <b>void</b>
556 notify_find_search_collision
562 <p>Notifies a search encountered a collision.</p>
569 <b>inline</b> <b>void</b>
570 notify_find_search_end
576 <p>Notifies a search ended.</p>
581 <h3><a name="link13" id="link13">Erase Search
582 Notifications.</a></h3>
584 <p>Notifications called during an insert operation.</p>
586 <table class="c1" width="100%" border="1" summary="Methods">
588 <td width="45%" align="left"><b>Method</b></td>
590 <td width="55%" align="left"><b>Description</b></td>
596 <b>inline</b> <b>void</b>
597 notify_erase_search_start
603 <p>Notifies a search started.</p>
610 <b>inline</b> <b>void</b>
611 notify_erase_search_collision
617 <p>Notifies a search encountered a collision.</p>
624 <b>inline</b> <b>void</b>
625 notify_erase_search_end
631 <p>Notifies a search ended.</p>
636 <h3><a name="link14" id="link14">Content Change
637 Notifications</a></h3>
639 <p>Notifications called when the content of the table changes
640 in a way that can affect the resize policy.</p>
642 <table class="c1" width="100%" border="1" summary="Methods">
644 <td width="45%" align="left"><b>Method</b></td>
646 <td width="55%" align="left"><b>Description</b></td>
652 <b>inline</b> <b>void</b>
654 (<a href="#size_type55424436"><tt>size_type</tt></a> num_e)
659 <p>Notifies an element was inserted.</p>
666 <b>inline</b> <b>void</b>
668 (<a href="#size_type55424436"><tt>size_type</tt></a> num_e)
673 <p>Notifies an element was erased.</p>
687 <p>Notifies the table was cleared.</p>
692 <h3><a name="link15" id="link15">Size Change
693 Notifications</a></h3>
695 <p>Notifications called when the table changes size.</p>
697 <table class="c1" width="100%" border="1" summary="Methods">
699 <td width="45%" align="left"><b>Method</b></td>
701 <td width="55%" align="left"><b>Description</b></td>
709 (<a href="#size_type55424436"><tt>size_type</tt></a> new_size)
714 <p>Notifies the table was resized to <span class=
715 "c1"><tt>new_size</tt></span>.</p>
720 <h3><a name="link16" id="link16">Queries</a></h3>
722 <p>Called to query whether/how to resize.</p>
724 <table class="c1" width="100%" border="1" summary="Methods">
726 <td width="45%" align="left"><b>Method</b></td>
728 <td width="55%" align="left"><b>Description</b></td>
734 <b>inline</b> <b>bool</b>
741 <p>Queries whether a resize is needed.</p>
748 <a href="#size_type55424436"><tt>size_type</tt></a>
750 (<a href="#size_type55424436"><tt>size_type</tt></a> size,
752 "#size_type55424436"><tt>size_type</tt></a> num_used_e) <b>const</b>
757 <p>Queries what the new <span class=
758 "c1"><tt>size</tt></span> should be, when the container
759 is resized naturally. The current size of the container
760 is <span class="c1"><tt>size</tt></span>, and the number
761 of used entries within the container is <span class=
762 "c1"><tt>num_used_e</tt></span>.</p>
767 <h2><a name="link17" id="link17">Private Methods</a></h2>
769 <h3><a name="link18" id="link18">Overrides</a></h3>
771 <table class="c1" width="100%" border="1" summary="Methods">
773 <td width="45%" align="left"><b>Method</b></td>
775 <td width="55%" align="left"><b>Description</b></td>
781 <b>virtual</b> <b>void</b>
783 (<a href="#size_type55424436"><tt>size_type</tt></a> new_size)
788 <p>Resizes to <span class=
789 "c1"><tt>new_size</tt></span>.</p>