OpenCores
URL https://opencores.org/ocsvn/scarts/scarts/trunk

Subversion Repositories scarts

[/] [scarts/] [trunk/] [toolchain/] [scarts-gcc/] [gcc-4.1.1/] [libstdc++-v3/] [docs/] [html/] [ext/] [pb_assoc/] [hash_load_check_resize_trigger.html] - Rev 20

Compare with Previous | Blame | View Log

 
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
 
 
<html>
<head>
<title>hash_load_check_resize_trigger Interface
</title>
 
</head>
 
<body>
<h1>
<tt>hash_load_check_resize_trigger
</tt>
 
 Interface
 
 
</h1>
 
<p>A resize trigger policy based on a load check. It keeps the load factor between some load factors load_min and load_max.
</p>
 
<ol>
<li>
<a href = "../../../../include/ext/pb_assoc/hash_policy.hpp"><tt>hash_policy.hpp</tt>
</a>
 
</li>
 
<li>
<a href = "#link1">Template parameters.
</a>
 
</li>
 
<li>
Public Types and Constants:
 
 
<ol>
<li>
<a href = "#link2">General definitions.
</a>
 
</li>
 
</ol>
 
</li>
 
<li>
Public Methods:
 
 
<ol>
<li>
<a href = "#link3">Constructors, destructor, and related.
</a>
 
</li>
 
<li>
<a href = "#link4">Load access methods.
</a>
 
</li>
 
</ol>
 
</li>
 
<li>
Protected Methods:
 
 
<ol>
<li>
<a href = "#link5">Insert search notifications.
</a>
 
</li>
 
<li>
<a href = "#link6">Find search notifications.
</a>
 
</li>
 
<li>
<a href = "#link7">Erase search notifications.
</a>
 
</li>
 
<li>
<a href = "#link8">Content change notifications.
</a>
 
</li>
 
<li>
<a href = "#link9">Size change notifications.
</a>
 
</li>
 
<li>
<a href = "#link10">Queries.
</a>
 
</li>
 
</ol>
 
</li>
 
</ol>
 
 
<h2>
<a name = "link1">Template parameters.
</a>
 
</h2>
 
<table WIDTH = "100%" BORDER = "1">
<TR><TD Width = "20%" ALIGN = "left"><b>Parameter</b></TD><TD Width = "50%" ALIGN = "left"><b>Description</b></TD><TD Width = "30%" ALIGN = "left"><b>Default Value</b></TD></TR>
 
 
<tr>
<td>
<pre><a name = "External_Load_Access3735929540">External_Load_Access</a></pre>
 
 
</td>
 
<td>
<p>Specifies whether the load factor can be accessed externally. The two options have different tradeoffs in terms of flexibility, genericity, and encapsulation.</p>
 
 
</td>
 
<td>
<tt><b>false</b></tt>
 
 
</td>
 
</tr>
 
<tr>
<td>
<pre><a name = "Size_Type3735929483">Size_Type</a></pre>
 
 
</td>
 
<td>
<p>Size type.</p>
 
 
</td>
 
<td>
size_t
 
 
</td>
 
</tr>
 
</table>
 
<h2>
<a name = "link2">General definitions.
</a>
 
</h2>
 
<table WIDTH = "100%" BORDER = "1">
<TR><TD Width = "30%" ALIGN = "left"><b>Type</b></TD><TD Width = "55%" ALIGN = "left"><b>Definition</b></TD><TD Width = "15%" ALIGN = "left"><b>Description</b></TD></TR>
 
 
<tr>
<td>
<pre><a name = "size_type3735929547">size_type</a></pre>
 
 
</td>
 
<td>
<pre><a href = "#Size_Type3735929483">Size_Type</a></pre>
 
 
</td>
 
<td>
<p>Size type.</p>
 
 
</td>
 
</tr>
 
<tr>
<td>
<pre><a name = "external_load_access3735929604">external_load_access</a></pre>
 
 
</td>
 
<td>
<pre><a href = "#External_Load_Access3735929540">External_Load_Access</a></pre>
 
 
</td>
 
<td>
<p>Indicates whether loads can be accessed externally</p>
 
 
</td>
 
</tr>
 
</table>
 
<h2>
<a name = "link3">Constructors, destructor, and related.
</a>
 
</h2>
 
<table WIDTH = "100%" BORDER = "1">
<TR><TD Width = "45%" ALIGN = "left"><b>Method</b></TD><TD Width = "55%" ALIGN = "left"><b>Description</b></TD></TR>
 
 
<tr>
<td>
<pre>  hash_load_check_resize_trigger
  (float load_min = 0.125,
    float load_max = 0.5)</pre>
 
 
</td>
 
<td>
<p>Default constructor, or constructor taking <font color = "#666666"><tt>load_min</tt></font> and <font color = "#666666"><tt>load_max</tt></font> load factors between which this policy will keep the actual load.</p>
 
 
<p>It is the responsibility of the user to ensure that <font color = "#666666"><tt>load_min</tt></font> is smaller than <font color = "#666666"><tt>load_max</tt></font>.</p>
 
 
</td>
 
</tr>
 
<tr>
<td>
<pre><b>void</b>
  swap
  (<font color = "olive">hash_load_check_resize_trigger</font> &amp;r_other)</pre>
 
 
</td>
 
<td>
<p>Swaps content.</p>
 
 
</td>
 
</tr>
 
<tr>
<td>
<pre>  <b>virtual</b>
    ~hash_load_check_resize_trigger
    ()</pre>
 
 
</td>
 
<td>
<p>Destructor.</p>
 
 
</td>
 
</tr>
 
</table>
 
<h2>
<a name = "link4">Load access methods.
</a>
 
</h2>
 
<p> These methods are only available if the external access parameter is set.</p>
 
 
<table WIDTH = "100%" BORDER = "1">
<TR><TD Width = "45%" ALIGN = "left"><b>Method</b></TD><TD Width = "55%" ALIGN = "left"><b>Description</b></TD></TR>
 
 
<tr>
<td>
<pre><b>inline</b> std::pair&lt;float, float&gt;
  get_loads
  () <b>const</b></pre>
 
 
</td>
 
<td>
<p>Returns a pair of the minimal and maximal loads, respectively.</p>
 
 
<p>Calling this method will not compile when <a href = "#External_Load_Access3735929540"><tt>External_Load_Access</tt></a> == <tt><b>false</b></tt>.</p>
 
 
</td>
 
</tr>
 
<tr>
<td>
<pre><b>void</b>
  set_loads
  (std::pair&lt;float, float&gt; load_pair)</pre>
 
 
</td>
 
<td>
<p>Sets the loads through a pair of the minimal and maximal loads, respectively.</p>
 
 
<p>Calling this method resizes the container, and might throw an exception. It is the responsibility of the user to pass appropriate loads to this function. Calling this method will not compile when <a href = "#External_Load_Access3735929540"><tt>External_Load_Access</tt></a> == <tt><b>false</b></tt>.</p>
 
 
</td>
 
</tr>
 
</table>
 
<h2>
<a name = "link5">Insert search notifications.
</a>
 
</h2>
 
<p>Notifications called during an insert operation.</p>
 
 
<table WIDTH = "100%" BORDER = "1">
<TR><TD Width = "45%" ALIGN = "left"><b>Method</b></TD><TD Width = "55%" ALIGN = "left"><b>Description</b></TD></TR>
 
 
<tr>
<td>
<pre><b>inline</b> <b>void</b>
  notify_insert_search_start
  ()</pre>
 
 
</td>
 
<td>
<p>Notifies a search started.</p>
 
 
</td>
 
</tr>
 
<tr>
<td>
<pre><b>inline</b> <b>void</b>
  notify_insert_search_collision
  ()</pre>
 
 
</td>
 
<td>
<p>Notifies a search encountered a collision.</p>
 
 
</td>
 
</tr>
 
<tr>
<td>
<pre><b>inline</b> <b>void</b>
  notify_insert_search_end
  ()</pre>
 
 
</td>
 
<td>
<p>Notifies a search ended.</p>
 
 
</td>
 
</tr>
 
</table>
 
<h2>
<a name = "link6">Find search notifications.
</a>
 
</h2>
 
<p>Notifications called during a find operation.</p>
 
 
<table WIDTH = "100%" BORDER = "1">
<TR><TD Width = "45%" ALIGN = "left"><b>Method</b></TD><TD Width = "55%" ALIGN = "left"><b>Description</b></TD></TR>
 
 
<tr>
<td>
<pre><b>inline</b> <b>void</b>
  notify_find_search_start
  ()</pre>
 
 
</td>
 
<td>
<p>Notifies a search started.</p>
 
 
</td>
 
</tr>
 
<tr>
<td>
<pre><b>inline</b> <b>void</b>
  notify_find_search_collision
  ()</pre>
 
 
</td>
 
<td>
<p>Notifies a search encountered a collision.</p>
 
 
</td>
 
</tr>
 
<tr>
<td>
<pre><b>inline</b> <b>void</b>
  notify_find_search_end
  ()</pre>
 
 
</td>
 
<td>
<p>Notifies a search ended.</p>
 
 
</td>
 
</tr>
 
</table>
 
<h2>
<a name = "link7">Erase search notifications.
</a>
 
</h2>
 
<p>Notifications called during an insert operation.</p>
 
 
<table WIDTH = "100%" BORDER = "1">
<TR><TD Width = "45%" ALIGN = "left"><b>Method</b></TD><TD Width = "55%" ALIGN = "left"><b>Description</b></TD></TR>
 
 
<tr>
<td>
<pre><b>inline</b> <b>void</b>
  notify_erase_search_start
  ()</pre>
 
 
</td>
 
<td>
<p>Notifies a search started.</p>
 
 
</td>
 
</tr>
 
<tr>
<td>
<pre><b>inline</b> <b>void</b>
  notify_erase_search_collision
  ()</pre>
 
 
</td>
 
<td>
<p>Notifies a search encountered a collision.</p>
 
 
</td>
 
</tr>
 
<tr>
<td>
<pre><b>inline</b> <b>void</b>
  notify_erase_search_end
  ()</pre>
 
 
</td>
 
<td>
<p>Notifies a search ended.</p>
 
 
</td>
 
</tr>
 
</table>
 
<h2>
<a name = "link8">Content change notifications.
</a>
 
</h2>
 
<p>Notifications called when the content of the table changes in a way that can affect the resize policy.</p>
 
 
<table WIDTH = "100%" BORDER = "1">
<TR><TD Width = "45%" ALIGN = "left"><b>Method</b></TD><TD Width = "55%" ALIGN = "left"><b>Description</b></TD></TR>
 
 
<tr>
<td>
<pre><b>inline</b> <b>void</b>
  notify_inserted
  (<a href = "#size_type3735929547">size_type</a> num_entries)</pre>
 
 
</td>
 
<td>
<p>Notifies an element was inserted. the total number of entries in the table is <font color = "#666666"><tt>num_entries</tt></font>.</p>
 
 
</td>
 
</tr>
 
<tr>
<td>
<pre><b>inline</b> <b>void</b>
  notify_erased
  (<a href = "#size_type3735929547">size_type</a> num_entries)</pre>
 
 
</td>
 
<td>
<p>Notifies an element was erased.</p>
 
 
</td>
 
</tr>
 
<tr>
<td>
<pre><b>void</b>
  notify_cleared
  ()</pre>
 
 
</td>
 
<td>
<p>Notifies the table was cleared.</p>
 
 
</td>
 
</tr>
 
</table>
 
<h2>
<a name = "link9">Size change notifications.
</a>
 
</h2>
 
<p>Notifications called when the table changes size.</p>
 
 
<table WIDTH = "100%" BORDER = "1">
<TR><TD Width = "45%" ALIGN = "left"><b>Method</b></TD><TD Width = "55%" ALIGN = "left"><b>Description</b></TD></TR>
 
 
<tr>
<td>
<pre><b>void</b>
  notify_resized
  (<a href = "#size_type3735929547">size_type</a> new_size)</pre>
 
 
</td>
 
<td>
<p>Notifies the table was resized as a result of this object's signifying that a resize is needed.</p>
 
 
</td>
 
</tr>
 
<tr>
<td>
<pre><b>void</b>
  notify_externally_resized
  (<a href = "#size_type3735929547">size_type</a> new_size)</pre>
 
 
</td>
 
<td>
<p>Notifies the table was resized externally.</p>
 
 
</td>
 
</tr>
 
</table>
 
<h2>
<a name = "link10">Queries.
</a>
 
</h2>
 
<p>Called to query whether/how to resize.</p>
 
 
<table WIDTH = "100%" BORDER = "1">
<TR><TD Width = "45%" ALIGN = "left"><b>Method</b></TD><TD Width = "55%" ALIGN = "left"><b>Description</b></TD></TR>
 
 
<tr>
<td>
<pre><b>inline</b> <b>bool</b>
  is_resize_needed
  () <b>const</b></pre>
 
 
</td>
 
<td>
<p>Queries whether a resize is needed.</p>
 
 
</td>
 
</tr>
 
<tr>
<td>
<pre><b>inline</b> <b>bool</b>
  is_grow_needed
  (<a href = "#size_type3735929547">size_type</a> size,
    <a href = "#size_type3735929547">size_type</a> num_entries) <b>const</b></pre>
 
 
</td>
 
<td>
<p>Queries whether a grow is needed.</p>
 
 
<p>This method is called only if this object indicated resize is needed. The actual <font color = "#666666"><tt>size</tt></font> of the table is <font color = "#666666"><tt>size</tt></font>, and the number of entries in it is <font color = "#666666"><tt>num_entries</tt></font>.</p>
 
 
</td>
 
</tr>
 
<tr>
<td>
<pre><b>inline</b> <b>bool</b>
  is_shrink_needed
  (<a href = "#size_type3735929547">size_type</a> size,
    <a href = "#size_type3735929547">size_type</a> num_entries) <b>const</b></pre>
 
 
</td>
 
<td>
<p>Queries whether a shrink is needed.</p>
 
 
<p>This method is called only if this object indicated resize is needed. The actual <font color = "#666666"><tt>size</tt></font> of the table is <font color = "#666666"><tt>size</tt></font>, and the number of entries in it is <font color = "#666666"><tt>num_entries</tt></font>.</p>
 
 
</td>
 
</tr>
 
</table>
 
 
 
</body>
 
</html>
 
 
 

Compare with Previous | Blame | View Log

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.