2 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
7 <title>sample_resize_policy Interface
14 <tt>sample_resize_policy
22 <p>A sample resize policy.
25 <p>This class serves to show the interface a resize policy needs to support.
30 <a href = "../doc/sample_resize_policy.hpp"><tt>sample_resize_policy.hpp</tt>
41 <a href = "#link1">Constructors, destructor, and related.
56 <a href = "#link2">Insert search notifications.
62 <a href = "#link3">Find search notifications.
68 <a href = "#link4">Erase search notifications.
74 <a href = "#link5">Content change notifications.
80 <a href = "#link6">Size change notifications.
86 <a href = "#link7">Queries.
99 <a name = "link1">Constructors, destructor, and related.
104 <table WIDTH = "100%" BORDER = "1">
105 <TR><TD Width = "45%" ALIGN = "left"><b>Method</b></TD><TD Width = "55%" ALIGN = "left"><b>Description</b></TD></TR>
110 <pre> sample_resize_policy
117 <p>Default constructor.</p>
120 <p>Must be default constructible.</p>
129 <pre> sample_range_hashing
130 (<b>const</b> sample_resize_policy &r_other)</pre>
136 <p>Copy constructor.</p>
139 <p>Must be copy constructible.</p>
148 <pre><b>inline</b> <b>void</b>
150 (sample_resize_policy &r_other)</pre>
156 <p>Swaps content.</p>
159 <p>Must be swappable (if there is such a word).</p>
169 <a name = "link2">Insert search notifications.
174 <p>Notifications called during an insert operation.</p>
177 <table WIDTH = "100%" BORDER = "1">
178 <TR><TD Width = "45%" ALIGN = "left"><b>Method</b></TD><TD Width = "55%" ALIGN = "left"><b>Description</b></TD></TR>
183 <pre><b>inline</b> <b>void</b>
184 notify_insert_search_start
191 <p>Notifies a search started.</p>
200 <pre><b>inline</b> <b>void</b>
201 notify_insert_search_collision
208 <p>Notifies a search encountered a collision.</p>
217 <pre><b>inline</b> <b>void</b>
218 notify_insert_search_end
225 <p>Notifies a search ended.</p>
235 <a name = "link3">Find search notifications.
240 <p>Notifications called during a find operation.</p>
243 <table WIDTH = "100%" BORDER = "1">
244 <TR><TD Width = "45%" ALIGN = "left"><b>Method</b></TD><TD Width = "55%" ALIGN = "left"><b>Description</b></TD></TR>
249 <pre><b>inline</b> <b>void</b>
250 notify_find_search_start
257 <p>Notifies a search started.</p>
266 <pre><b>inline</b> <b>void</b>
267 notify_find_search_collision
274 <p>Notifies a search encountered a collision.</p>
283 <pre><b>inline</b> <b>void</b>
284 notify_find_search_end
291 <p>Notifies a search ended.</p>
301 <a name = "link4">Erase search notifications.
306 <p>Notifications called during an insert operation.</p>
309 <table WIDTH = "100%" BORDER = "1">
310 <TR><TD Width = "45%" ALIGN = "left"><b>Method</b></TD><TD Width = "55%" ALIGN = "left"><b>Description</b></TD></TR>
315 <pre><b>inline</b> <b>void</b>
316 notify_erase_search_start
323 <p>Notifies a search started.</p>
332 <pre><b>inline</b> <b>void</b>
333 notify_erase_search_collision
340 <p>Notifies a search encountered a collision.</p>
349 <pre><b>inline</b> <b>void</b>
350 notify_erase_search_end
357 <p>Notifies a search ended.</p>
367 <a name = "link5">Content change notifications.
372 <p>Notifications called when the content of the table changes in a way that can affect the resize policy.</p>
375 <table WIDTH = "100%" BORDER = "1">
376 <TR><TD Width = "45%" ALIGN = "left"><b>Method</b></TD><TD Width = "55%" ALIGN = "left"><b>Description</b></TD></TR>
381 <pre><b>inline</b> <b>void</b>
383 (size_type num_e)</pre>
389 <p>Notifies an element was inserted.</p>
398 <pre><b>inline</b> <b>void</b>
400 (size_type num_e)</pre>
406 <p>Notifies an element was erased.</p>
423 <p>Notifies the table was cleared.</p>
433 <a name = "link6">Size change notifications.
438 <p>Notifications called when the table changes size.</p>
441 <table WIDTH = "100%" BORDER = "1">
442 <TR><TD Width = "45%" ALIGN = "left"><b>Method</b></TD><TD Width = "55%" ALIGN = "left"><b>Description</b></TD></TR>
449 (size_type new_size)</pre>
455 <p>Notifies the table was resized to <font color = "#666666"><tt>new_size</tt></font>.</p>
465 <a name = "link7">Queries.
470 <p>Called to query whether/how to resize.</p>
473 <table WIDTH = "100%" BORDER = "1">
474 <TR><TD Width = "45%" ALIGN = "left"><b>Method</b></TD><TD Width = "55%" ALIGN = "left"><b>Description</b></TD></TR>
481 () <b>const</b></pre>
487 <p>Queries initial size.</p>
496 <pre><b>inline</b> <b>bool</b>
498 () <b>const</b></pre>
504 <p>Queries whether a resize is needed.</p>
515 (size_type size, size_type num_used_e) <b>const</b></pre>
521 <p>Queries what the new <font color = "#666666"><tt>size</tt></font> should be.</p>