803 lines
43 KiB
HTML
Executable File
803 lines
43 KiB
HTML
Executable File
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
|
|
<html><head><meta http-equiv="Content-Type" content="text/html;charset=UTF-8">
|
|
<title>GIMPACT: gim_hash_table< T > Class Template Reference</title>
|
|
<link href="doxygen.css" rel="stylesheet" type="text/css">
|
|
<link href="tabs.css" rel="stylesheet" type="text/css">
|
|
</head><body>
|
|
<!-- Generated by Doxygen 1.5.2 -->
|
|
<div class="tabs">
|
|
<ul>
|
|
<li><a href="index.html"><span>Main Page</span></a></li>
|
|
<li><a href="modules.html"><span>Modules</span></a></li>
|
|
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
|
|
<li><a href="files.html"><span>Files</span></a></li>
|
|
</ul>
|
|
</div>
|
|
<div class="tabs">
|
|
<ul>
|
|
<li><a href="annotated.html"><span>Class List</span></a></li>
|
|
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
|
|
<li><a href="functions.html"><span>Class Members</span></a></li>
|
|
</ul>
|
|
</div>
|
|
<h1>gim_hash_table< T > Class Template Reference<br>
|
|
<small>
|
|
[<a class="el" href="group___c_o_n_t_a_i_n_e_r_s.html">CONTAINERS</a>]</small>
|
|
</h1><!-- doxytag: class="gim_hash_table" -->A compact hash table implementation.
|
|
<a href="#_details">More...</a>
|
|
<p>
|
|
<code>#include <gim_hash_table.h></code>
|
|
<p>
|
|
<a href="classgim__hash__table-members.html">List of all members.</a><table border="0" cellpadding="0" cellspacing="0">
|
|
<tr><td></td></tr>
|
|
<tr><td colspan="2"><br><h2>Public Member Functions</h2></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classgim__hash__table.html#efe21c907c69c8077ec0886aaa778f6f">gim_hash_table</a> (GUINT reserve_size=GIM_DEFAULT_HASH_TABLE_SIZE, GUINT node_size=GIM_DEFAULT_HASH_TABLE_NODE_SIZE, GUINT min_hash_table_size=GIM_INVALID_HASH)</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="classgim__hash__table.html#4fd8d9d9d31a115c32937035fdc54993">~gim_hash_table</a> ()</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classgim__hash__table.html#b7ab2e3e9ac09ec98d5c7112ea092aad">is_hash_table</a> ()</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classgim__hash__table.html#075a9857030ef2630d036b57778e2a46">is_sorted</a> ()</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classgim__hash__table.html#dc65cdfbdb6906e4d0ebf66766f65557">sort</a> ()</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classgim__hash__table.html#02b51868862156240818dafe2f8df01d">switch_to_hashtable</a> ()</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classgim__hash__table.html#cf8117de90e6486e712fc6184ea40225">switch_to_sorted_array</a> ()</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classgim__hash__table.html#ba33eeb9b5aa00b0d8a002c549b71ed3">check_for_switching_to_hashtable</a> ()</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">If the container reaches the. <a href="#ba33eeb9b5aa00b0d8a002c549b71ed3"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classgim__hash__table.html#be1662ebb0f7a17a84e7fc5d0f993c58">set_sorted</a> (bool value)</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">GUINT </td><td class="memItemRight" valign="bottom"><a class="el" href="classgim__hash__table.html#77994868ac8519736e69c93c1c989dde">size</a> () const</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Retrieves the amount of keys. <a href="#77994868ac8519736e69c93c1c989dde"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">GUINT </td><td class="memItemRight" valign="bottom"><a class="el" href="classgim__hash__table.html#a9f8b2ae1ac505ed5dfe73b83510dad0">get_key</a> (GUINT index) const</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Retrieves the hash key. <a href="#a9f8b2ae1ac505ed5dfe73b83510dad0"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">T * </td><td class="memItemRight" valign="bottom"><a class="el" href="classgim__hash__table.html#b5ec54c3096e790e8c7ae570300df95d">get_value_by_index</a> (GUINT index)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Retrieves the value by index. <a href="#b5ec54c3096e790e8c7ae570300df95d"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">const T & </td><td class="memItemRight" valign="bottom"><a class="el" href="classgim__hash__table.html#8462bb3aa6342465fc54659648f8c8c9">operator[]</a> (GUINT index) const</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">T & </td><td class="memItemRight" valign="bottom"><a class="el" href="classgim__hash__table.html#0df819cc9b510d933132f2e5d5f87488">operator[]</a> (GUINT index)</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">GUINT </td><td class="memItemRight" valign="bottom"><a class="el" href="classgim__hash__table.html#14261b2d7de34188f8bc5179e4d60760">find</a> (GUINT hashkey)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Finds the index of the element with the key. <a href="#14261b2d7de34188f8bc5179e4d60760"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">T * </td><td class="memItemRight" valign="bottom"><a class="el" href="classgim__hash__table.html#40b5c46a0117da3948cd1b093f185321">get_value</a> (GUINT hashkey)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Retrieves the value associated with the index. <a href="#40b5c46a0117da3948cd1b093f185321"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classgim__hash__table.html#bd4a9523a14496c9e3eacd7f790dad2c">erase_by_index</a> (GUINT index)</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classgim__hash__table.html#22cce5d8ed58cfb7e16d6b81aaf5acb7">erase_by_index_unsorted</a> (GUINT index)</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classgim__hash__table.html#156d142f1eb74c3ef758a14fffe1763a">erase_by_key</a> (GUINT hashkey)</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="classgim__hash__table.html#1574ca1850a9258db8b778282134ff42">clear</a> ()</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">GUINT </td><td class="memItemRight" valign="bottom"><a class="el" href="classgim__hash__table.html#ff0e9bdb5bd6aacf9272db6789c514f7">insert</a> (GUINT hashkey, const T &element)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Insert an element into the hash. <a href="#ff0e9bdb5bd6aacf9272db6789c514f7"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">GUINT </td><td class="memItemRight" valign="bottom"><a class="el" href="classgim__hash__table.html#83987136757654921c71b183de8ec55e">insert_override</a> (GUINT hashkey, const T &element)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Insert an element into the hash, and could overrite an existing object with the same hash. <a href="#83987136757654921c71b183de8ec55e"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">GUINT </td><td class="memItemRight" valign="bottom"><a class="el" href="classgim__hash__table.html#be9a629ec7dfe612065ed9d161adc7e8">insert_unsorted</a> (GUINT hashkey, const T &element)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Insert an element into the hash,But if this container is a sorted array, this inserts it unsorted. <a href="#be9a629ec7dfe612065ed9d161adc7e8"></a><br></td></tr>
|
|
<tr><td colspan="2"><br><h2>Protected Types</h2></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">typedef <a class="el" href="struct_g_i_m___h_a_s_h___t_a_b_l_e___n_o_d_e.html">GIM_HASH_TABLE_NODE</a><<br>
|
|
T > </td><td class="memItemRight" valign="bottom"><a class="el" href="classgim__hash__table.html#93f9195325cf57b3789e575a18a929a5">_node_type</a></td></tr>
|
|
|
|
<tr><td colspan="2"><br><h2>Protected Member Functions</h2></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">GUINT </td><td class="memItemRight" valign="bottom"><a class="el" href="group___h_a_s_h___t_a_b_l_e___s_t_r_u_c_t_u_r_e_s.html#gaaff4cea9e6b86276d364041e651605f">_find_cell</a> (GUINT hashkey)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Returns the cell index. <a href="group___h_a_s_h___t_a_b_l_e___s_t_r_u_c_t_u_r_e_s.html#gaaff4cea9e6b86276d364041e651605f"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">GUINT </td><td class="memItemRight" valign="bottom"><a class="el" href="group___h_a_s_h___t_a_b_l_e___s_t_r_u_c_t_u_r_e_s.html#gcc2d3d29a0190232386fb155ec9e5d8f">_find_avaliable_cell</a> (GUINT hashkey)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Find the avaliable cell for the hashkey, and return an existing cell if it has the same hash key. <a href="group___h_a_s_h___t_a_b_l_e___s_t_r_u_c_t_u_r_e_s.html#gcc2d3d29a0190232386fb155ec9e5d8f"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group___h_a_s_h___t_a_b_l_e___s_t_r_u_c_t_u_r_e_s.html#g4d9347e131c0e17ac2d4966c092817f8">_reserve_table_memory</a> (GUINT newtablesize)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">reserves the memory for the hash table. <a href="group___h_a_s_h___t_a_b_l_e___s_t_r_u_c_t_u_r_e_s.html#g4d9347e131c0e17ac2d4966c092817f8"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group___h_a_s_h___t_a_b_l_e___s_t_r_u_c_t_u_r_e_s.html#gb638970e2ec565cc9cfd473612127358">_invalidate_keys</a> ()</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group___h_a_s_h___t_a_b_l_e___s_t_r_u_c_t_u_r_e_s.html#g06933fdb198971dcd753564d1d6e9424">_clear_table_memory</a> ()</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Clear all memory for the hash table. <a href="group___h_a_s_h___t_a_b_l_e___s_t_r_u_c_t_u_r_e_s.html#g06933fdb198971dcd753564d1d6e9424"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group___h_a_s_h___t_a_b_l_e___s_t_r_u_c_t_u_r_e_s.html#ga33115e75d8cc5c489fa6ce8b1a23654">_rehash</a> ()</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Invalidates the keys (Assigning GIM_INVALID_HASH to all) Reorders the hash keys. <a href="group___h_a_s_h___t_a_b_l_e___s_t_r_u_c_t_u_r_e_s.html#ga33115e75d8cc5c489fa6ce8b1a23654"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group___h_a_s_h___t_a_b_l_e___s_t_r_u_c_t_u_r_e_s.html#g51905040dee4c41954f5de1634c090dd">_resize_table</a> (GUINT newsize)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Resize hash table indices. <a href="group___h_a_s_h___t_a_b_l_e___s_t_r_u_c_t_u_r_e_s.html#g51905040dee4c41954f5de1634c090dd"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group___h_a_s_h___t_a_b_l_e___s_t_r_u_c_t_u_r_e_s.html#g2b7a2b3eb817edf8af93a85ce910a5ca">_destroy</a> ()</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Destroy hash table memory. <a href="group___h_a_s_h___t_a_b_l_e___s_t_r_u_c_t_u_r_e_s.html#g2b7a2b3eb817edf8af93a85ce910a5ca"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">GUINT </td><td class="memItemRight" valign="bottom"><a class="el" href="group___h_a_s_h___t_a_b_l_e___s_t_r_u_c_t_u_r_e_s.html#g93e5bf5c573a39e21e9bd0a4aec38e1a">_assign_hash_table_cell</a> (GUINT hashkey)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Finds an avaliable hash table cell, and resizes the table if there isn't space. <a href="group___h_a_s_h___t_a_b_l_e___s_t_r_u_c_t_u_r_e_s.html#g93e5bf5c573a39e21e9bd0a4aec38e1a"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group___h_a_s_h___t_a_b_l_e___s_t_r_u_c_t_u_r_e_s.html#gfbaacd523281706f94476ae60917856e">_erase_by_index_hash_table</a> (GUINT index)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">erase by index in hash table <a href="group___h_a_s_h___t_a_b_l_e___s_t_r_u_c_t_u_r_e_s.html#gfbaacd523281706f94476ae60917856e"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group___h_a_s_h___t_a_b_l_e___s_t_r_u_c_t_u_r_e_s.html#gf03ef67dcf7b0e805e34df6a5de4425f">_erase_hash_table</a> (GUINT hashkey)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">erase by key in hash table <a href="group___h_a_s_h___t_a_b_l_e___s_t_r_u_c_t_u_r_e_s.html#gf03ef67dcf7b0e805e34df6a5de4425f"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">GUINT </td><td class="memItemRight" valign="bottom"><a class="el" href="group___h_a_s_h___t_a_b_l_e___s_t_r_u_c_t_u_r_e_s.html#g4339a279d721d1e687b8d8063332bac8">_insert_hash_table</a> (GUINT hashkey, const T &value)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">insert an element in hash table <a href="group___h_a_s_h___t_a_b_l_e___s_t_r_u_c_t_u_r_e_s.html#g4339a279d721d1e687b8d8063332bac8"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">GUINT </td><td class="memItemRight" valign="bottom"><a class="el" href="group___h_a_s_h___t_a_b_l_e___s_t_r_u_c_t_u_r_e_s.html#g6ebfb7415bd946855ec5730651f7c191">_insert_hash_table_replace</a> (GUINT hashkey, const T &value)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">insert an element in hash table. <a href="group___h_a_s_h___t_a_b_l_e___s_t_r_u_c_t_u_r_e_s.html#g6ebfb7415bd946855ec5730651f7c191"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_o_r_t_e_d___a_r_r_a_y___s_t_r_u_c_t_u_r_e_s.html#ge347a062b1b5907b81127e6bacbbb10e">_erase_sorted</a> (GUINT index)</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_o_r_t_e_d___a_r_r_a_y___s_t_r_u_c_t_u_r_e_s.html#g0b68afa191499a10ac7d7c34230a7d89">_erase_unsorted</a> (GUINT index)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">faster, but unsorted <a href="group___s_o_r_t_e_d___a_r_r_a_y___s_t_r_u_c_t_u_r_e_s.html#g0b68afa191499a10ac7d7c34230a7d89"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_o_r_t_e_d___a_r_r_a_y___s_t_r_u_c_t_u_r_e_s.html#g3eacaf88e1b18815c0b89d368d77a93a">_insert_in_pos</a> (GUINT hashkey, const T &value, GUINT pos)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Insert in position ordered. <a href="group___s_o_r_t_e_d___a_r_r_a_y___s_t_r_u_c_t_u_r_e_s.html#g3eacaf88e1b18815c0b89d368d77a93a"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">GUINT </td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_o_r_t_e_d___a_r_r_a_y___s_t_r_u_c_t_u_r_e_s.html#g66d18cb60b0628a9aa759304395f4825">_insert_sorted</a> (GUINT hashkey, const T &value)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Insert an element in an ordered array. <a href="group___s_o_r_t_e_d___a_r_r_a_y___s_t_r_u_c_t_u_r_e_s.html#g66d18cb60b0628a9aa759304395f4825"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">GUINT </td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_o_r_t_e_d___a_r_r_a_y___s_t_r_u_c_t_u_r_e_s.html#gc221e1462f7711085b1260fc229b6183">_insert_sorted_replace</a> (GUINT hashkey, const T &value)</td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">GUINT </td><td class="memItemRight" valign="bottom"><a class="el" href="group___s_o_r_t_e_d___a_r_r_a_y___s_t_r_u_c_t_u_r_e_s.html#g95f93f63d75663f494388dc03423332f">_insert_unsorted</a> (GUINT hashkey, const T &value)</td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">Fast insertion in m_nodes array. <a href="group___s_o_r_t_e_d___a_r_r_a_y___s_t_r_u_c_t_u_r_e_s.html#g95f93f63d75663f494388dc03423332f"></a><br></td></tr>
|
|
<tr><td colspan="2"><br><h2>Protected Attributes</h2></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top"><a class="el" href="classgim__array.html">gim_array</a>< <a class="el" href="struct_g_i_m___h_a_s_h___t_a_b_l_e___n_o_d_e.html">_node_type</a> > </td><td class="memItemRight" valign="bottom"><a class="el" href="classgim__hash__table.html#da83cac38bcf3fd282287f463def04e4">m_nodes</a></td></tr>
|
|
|
|
<tr><td class="mdescLeft"> </td><td class="mdescRight">The nodes. <a href="#da83cac38bcf3fd282287f463def04e4"></a><br></td></tr>
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">bool </td><td class="memItemRight" valign="bottom"><a class="el" href="classgim__hash__table.html#defa6197dfd5c1564969b38d4d27848b">m_sorted</a></td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">GUINT * </td><td class="memItemRight" valign="bottom"><a class="el" href="group___h_a_s_h___t_a_b_l_e___s_t_r_u_c_t_u_r_e_s.html#g35f6b0d640222067b9c76e61887e0354">m_hash_table</a></td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">GUINT </td><td class="memItemRight" valign="bottom"><a class="el" href="group___h_a_s_h___t_a_b_l_e___s_t_r_u_c_t_u_r_e_s.html#g39de8ad99c0fd79c595aa95d14be4e72">m_table_size</a></td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">GUINT </td><td class="memItemRight" valign="bottom"><a class="el" href="group___h_a_s_h___t_a_b_l_e___s_t_r_u_c_t_u_r_e_s.html#g1f81ffd2e5dd96b222eafa228ae6aa9c">m_node_size</a></td></tr>
|
|
|
|
<tr><td class="memItemLeft" nowrap align="right" valign="top">GUINT </td><td class="memItemRight" valign="bottom"><a class="el" href="group___h_a_s_h___t_a_b_l_e___s_t_r_u_c_t_u_r_e_s.html#gd0eb38448dd75c3a7964ff0fd5c6c7d0">m_min_hash_table_size</a></td></tr>
|
|
|
|
</table>
|
|
<hr><a name="_details"></a><h2>Detailed Description</h2>
|
|
<h3>template<class T><br>
|
|
class gim_hash_table< T ></h3>
|
|
|
|
A compact hash table implementation.
|
|
<p>
|
|
A memory aligned compact hash table that coud be treated as an array. It could be a simple sorted array without the overhead of the hash key bucked, or could be a formely hash table with an array of keys. You can use <a class="el" href="classgim__hash__table.html#02b51868862156240818dafe2f8df01d">switch_to_hashtable()</a> and switch_to_sorted_array for saving space or increase speed. <p>
|
|
<ul>
|
|
<li>
|
|
if node_size = 0, then this container becomes a simple sorted array allocator. reserve_size is used for reserve memory in m_nodes. When the array size reaches the size equivalent to 'min_hash_table_size', then it becomes a hash table by calling check_for_switching_to_hashtable. </li>
|
|
<li>
|
|
If node_size != 0, then this container becomes a hash table for ever </li>
|
|
</ul>
|
|
|
|
<p>
|
|
<hr><h2>Member Typedef Documentation</h2>
|
|
<a class="anchor" name="93f9195325cf57b3789e575a18a929a5"></a><!-- doxytag: member="gim_hash_table::_node_type" ref="93f9195325cf57b3789e575a18a929a5" args="" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<class T> </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">typedef <a class="el" href="struct_g_i_m___h_a_s_h___t_a_b_l_e___n_o_d_e.html">GIM_HASH_TABLE_NODE</a><T> <a class="el" href="classgim__hash__table.html">gim_hash_table</a>< T >::<a class="el" href="struct_g_i_m___h_a_s_h___t_a_b_l_e___n_o_d_e.html">_node_type</a><code> [protected]</code> </td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
|
|
</div>
|
|
</div><p>
|
|
<hr><h2>Constructor & Destructor Documentation</h2>
|
|
<a class="anchor" name="efe21c907c69c8077ec0886aaa778f6f"></a><!-- doxytag: member="gim_hash_table::gim_hash_table" ref="efe21c907c69c8077ec0886aaa778f6f" args="(GUINT reserve_size=GIM_DEFAULT_HASH_TABLE_SIZE, GUINT node_size=GIM_DEFAULT_HASH_TABLE_NODE_SIZE, GUINT min_hash_table_size=GIM_INVALID_HASH)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<class T> </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="classgim__hash__table.html">gim_hash_table</a>< T >::<a class="el" href="classgim__hash__table.html">gim_hash_table</a> </td>
|
|
<td>(</td>
|
|
<td class="paramtype">GUINT </td>
|
|
<td class="paramname"> <em>reserve_size</em> = <code>GIM_DEFAULT_HASH_TABLE_SIZE</code>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">GUINT </td>
|
|
<td class="paramname"> <em>node_size</em> = <code>GIM_DEFAULT_HASH_TABLE_NODE_SIZE</code>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">GUINT </td>
|
|
<td class="paramname"> <em>min_hash_table_size</em> = <code>GIM_INVALID_HASH</code></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td width="100%"><code> [inline]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
if node_size = 0, then this container becomes a simple sorted array allocator. reserve_size is used for reserve memory in m_nodes. When the array size reaches the size equivalent to 'min_hash_table_size', then it becomes a hash table by calling check_for_switching_to_hashtable. If node_size != 0, then this container becomes a hash table for ever
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="4fd8d9d9d31a115c32937035fdc54993"></a><!-- doxytag: member="gim_hash_table::~gim_hash_table" ref="4fd8d9d9d31a115c32937035fdc54993" args="()" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<class T> </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="classgim__hash__table.html">gim_hash_table</a>< T >::~<a class="el" href="classgim__hash__table.html">gim_hash_table</a> </td>
|
|
<td>(</td>
|
|
<td class="paramname"> </td>
|
|
<td> ) </td>
|
|
<td width="100%"><code> [inline]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
|
|
</div>
|
|
</div><p>
|
|
<hr><h2>Member Function Documentation</h2>
|
|
<a class="anchor" name="b7ab2e3e9ac09ec98d5c7112ea092aad"></a><!-- doxytag: member="gim_hash_table::is_hash_table" ref="b7ab2e3e9ac09ec98d5c7112ea092aad" args="()" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<class T> </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool <a class="el" href="classgim__hash__table.html">gim_hash_table</a>< T >::is_hash_table </td>
|
|
<td>(</td>
|
|
<td class="paramname"> </td>
|
|
<td> ) </td>
|
|
<td width="100%"><code> [inline]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="075a9857030ef2630d036b57778e2a46"></a><!-- doxytag: member="gim_hash_table::is_sorted" ref="075a9857030ef2630d036b57778e2a46" args="()" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<class T> </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool <a class="el" href="classgim__hash__table.html">gim_hash_table</a>< T >::is_sorted </td>
|
|
<td>(</td>
|
|
<td class="paramname"> </td>
|
|
<td> ) </td>
|
|
<td width="100%"><code> [inline]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="dc65cdfbdb6906e4d0ebf66766f65557"></a><!-- doxytag: member="gim_hash_table::sort" ref="dc65cdfbdb6906e4d0ebf66766f65557" args="()" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<class T> </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool <a class="el" href="classgim__hash__table.html">gim_hash_table</a>< T >::sort </td>
|
|
<td>(</td>
|
|
<td class="paramname"> </td>
|
|
<td> ) </td>
|
|
<td width="100%"><code> [inline]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="02b51868862156240818dafe2f8df01d"></a><!-- doxytag: member="gim_hash_table::switch_to_hashtable" ref="02b51868862156240818dafe2f8df01d" args="()" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<class T> </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool <a class="el" href="classgim__hash__table.html">gim_hash_table</a>< T >::switch_to_hashtable </td>
|
|
<td>(</td>
|
|
<td class="paramname"> </td>
|
|
<td> ) </td>
|
|
<td width="100%"><code> [inline]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="cf8117de90e6486e712fc6184ea40225"></a><!-- doxytag: member="gim_hash_table::switch_to_sorted_array" ref="cf8117de90e6486e712fc6184ea40225" args="()" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<class T> </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool <a class="el" href="classgim__hash__table.html">gim_hash_table</a>< T >::switch_to_sorted_array </td>
|
|
<td>(</td>
|
|
<td class="paramname"> </td>
|
|
<td> ) </td>
|
|
<td width="100%"><code> [inline]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="ba33eeb9b5aa00b0d8a002c549b71ed3"></a><!-- doxytag: member="gim_hash_table::check_for_switching_to_hashtable" ref="ba33eeb9b5aa00b0d8a002c549b71ed3" args="()" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<class T> </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool <a class="el" href="classgim__hash__table.html">gim_hash_table</a>< T >::check_for_switching_to_hashtable </td>
|
|
<td>(</td>
|
|
<td class="paramname"> </td>
|
|
<td> ) </td>
|
|
<td width="100%"><code> [inline]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
If the container reaches the.
|
|
<p>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="be1662ebb0f7a17a84e7fc5d0f993c58"></a><!-- doxytag: member="gim_hash_table::set_sorted" ref="be1662ebb0f7a17a84e7fc5d0f993c58" args="(bool value)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<class T> </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void <a class="el" href="classgim__hash__table.html">gim_hash_table</a>< T >::set_sorted </td>
|
|
<td>(</td>
|
|
<td class="paramtype">bool </td>
|
|
<td class="paramname"> <em>value</em> </td>
|
|
<td> ) </td>
|
|
<td width="100%"><code> [inline]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="77994868ac8519736e69c93c1c989dde"></a><!-- doxytag: member="gim_hash_table::size" ref="77994868ac8519736e69c93c1c989dde" args="() const" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<class T> </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">GUINT <a class="el" href="classgim__hash__table.html">gim_hash_table</a>< T >::size </td>
|
|
<td>(</td>
|
|
<td class="paramname"> </td>
|
|
<td> ) </td>
|
|
<td width="100%"> const<code> [inline]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Retrieves the amount of keys.
|
|
<p>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="a9f8b2ae1ac505ed5dfe73b83510dad0"></a><!-- doxytag: member="gim_hash_table::get_key" ref="a9f8b2ae1ac505ed5dfe73b83510dad0" args="(GUINT index) const" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<class T> </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">GUINT <a class="el" href="classgim__hash__table.html">gim_hash_table</a>< T >::get_key </td>
|
|
<td>(</td>
|
|
<td class="paramtype">GUINT </td>
|
|
<td class="paramname"> <em>index</em> </td>
|
|
<td> ) </td>
|
|
<td width="100%"> const<code> [inline]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Retrieves the hash key.
|
|
<p>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="b5ec54c3096e790e8c7ae570300df95d"></a><!-- doxytag: member="gim_hash_table::get_value_by_index" ref="b5ec54c3096e790e8c7ae570300df95d" args="(GUINT index)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<class T> </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">T* <a class="el" href="classgim__hash__table.html">gim_hash_table</a>< T >::get_value_by_index </td>
|
|
<td>(</td>
|
|
<td class="paramtype">GUINT </td>
|
|
<td class="paramname"> <em>index</em> </td>
|
|
<td> ) </td>
|
|
<td width="100%"><code> [inline]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Retrieves the value by index.
|
|
<p>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="8462bb3aa6342465fc54659648f8c8c9"></a><!-- doxytag: member="gim_hash_table::operator[]" ref="8462bb3aa6342465fc54659648f8c8c9" args="(GUINT index) const" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<class T> </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">const T& <a class="el" href="classgim__hash__table.html">gim_hash_table</a>< T >::operator[] </td>
|
|
<td>(</td>
|
|
<td class="paramtype">GUINT </td>
|
|
<td class="paramname"> <em>index</em> </td>
|
|
<td> ) </td>
|
|
<td width="100%"> const<code> [inline]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="0df819cc9b510d933132f2e5d5f87488"></a><!-- doxytag: member="gim_hash_table::operator[]" ref="0df819cc9b510d933132f2e5d5f87488" args="(GUINT index)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<class T> </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">T& <a class="el" href="classgim__hash__table.html">gim_hash_table</a>< T >::operator[] </td>
|
|
<td>(</td>
|
|
<td class="paramtype">GUINT </td>
|
|
<td class="paramname"> <em>index</em> </td>
|
|
<td> ) </td>
|
|
<td width="100%"><code> [inline]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="14261b2d7de34188f8bc5179e4d60760"></a><!-- doxytag: member="gim_hash_table::find" ref="14261b2d7de34188f8bc5179e4d60760" args="(GUINT hashkey)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<class T> </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">GUINT <a class="el" href="classgim__hash__table.html">gim_hash_table</a>< T >::find </td>
|
|
<td>(</td>
|
|
<td class="paramtype">GUINT </td>
|
|
<td class="paramname"> <em>hashkey</em> </td>
|
|
<td> ) </td>
|
|
<td width="100%"><code> [inline]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Finds the index of the element with the key.
|
|
<p>
|
|
<dl class="return" compact><dt><b>Returns:</b></dt><dd>the index in the array of the existing element,or GIM_INVALID_HASH if the element has been inserted If so, the element has been inserted at the last position of the array. </dd></dl>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="40b5c46a0117da3948cd1b093f185321"></a><!-- doxytag: member="gim_hash_table::get_value" ref="40b5c46a0117da3948cd1b093f185321" args="(GUINT hashkey)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<class T> </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">T* <a class="el" href="classgim__hash__table.html">gim_hash_table</a>< T >::get_value </td>
|
|
<td>(</td>
|
|
<td class="paramtype">GUINT </td>
|
|
<td class="paramname"> <em>hashkey</em> </td>
|
|
<td> ) </td>
|
|
<td width="100%"><code> [inline]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Retrieves the value associated with the index.
|
|
<p>
|
|
<dl class="return" compact><dt><b>Returns:</b></dt><dd>the found element, or null </dd></dl>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="bd4a9523a14496c9e3eacd7f790dad2c"></a><!-- doxytag: member="gim_hash_table::erase_by_index" ref="bd4a9523a14496c9e3eacd7f790dad2c" args="(GUINT index)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<class T> </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool <a class="el" href="classgim__hash__table.html">gim_hash_table</a>< T >::erase_by_index </td>
|
|
<td>(</td>
|
|
<td class="paramtype">GUINT </td>
|
|
<td class="paramname"> <em>index</em> </td>
|
|
<td> ) </td>
|
|
<td width="100%"><code> [inline]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="22cce5d8ed58cfb7e16d6b81aaf5acb7"></a><!-- doxytag: member="gim_hash_table::erase_by_index_unsorted" ref="22cce5d8ed58cfb7e16d6b81aaf5acb7" args="(GUINT index)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<class T> </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool <a class="el" href="classgim__hash__table.html">gim_hash_table</a>< T >::erase_by_index_unsorted </td>
|
|
<td>(</td>
|
|
<td class="paramtype">GUINT </td>
|
|
<td class="paramname"> <em>index</em> </td>
|
|
<td> ) </td>
|
|
<td width="100%"><code> [inline]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="156d142f1eb74c3ef758a14fffe1763a"></a><!-- doxytag: member="gim_hash_table::erase_by_key" ref="156d142f1eb74c3ef758a14fffe1763a" args="(GUINT hashkey)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<class T> </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool <a class="el" href="classgim__hash__table.html">gim_hash_table</a>< T >::erase_by_key </td>
|
|
<td>(</td>
|
|
<td class="paramtype">GUINT </td>
|
|
<td class="paramname"> <em>hashkey</em> </td>
|
|
<td> ) </td>
|
|
<td width="100%"><code> [inline]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="1574ca1850a9258db8b778282134ff42"></a><!-- doxytag: member="gim_hash_table::clear" ref="1574ca1850a9258db8b778282134ff42" args="()" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<class T> </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">void <a class="el" href="classgim__hash__table.html">gim_hash_table</a>< T >::clear </td>
|
|
<td>(</td>
|
|
<td class="paramname"> </td>
|
|
<td> ) </td>
|
|
<td width="100%"><code> [inline]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="ff0e9bdb5bd6aacf9272db6789c514f7"></a><!-- doxytag: member="gim_hash_table::insert" ref="ff0e9bdb5bd6aacf9272db6789c514f7" args="(GUINT hashkey, const T &element)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<class T> </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">GUINT <a class="el" href="classgim__hash__table.html">gim_hash_table</a>< T >::insert </td>
|
|
<td>(</td>
|
|
<td class="paramtype">GUINT </td>
|
|
<td class="paramname"> <em>hashkey</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const T & </td>
|
|
<td class="paramname"> <em>element</em></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td width="100%"><code> [inline]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Insert an element into the hash.
|
|
<p>
|
|
<dl class="return" compact><dt><b>Returns:</b></dt><dd>If GIM_INVALID_HASH, the object has been inserted succesfully. Else it returns the position of the existing element. </dd></dl>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="83987136757654921c71b183de8ec55e"></a><!-- doxytag: member="gim_hash_table::insert_override" ref="83987136757654921c71b183de8ec55e" args="(GUINT hashkey, const T &element)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<class T> </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">GUINT <a class="el" href="classgim__hash__table.html">gim_hash_table</a>< T >::insert_override </td>
|
|
<td>(</td>
|
|
<td class="paramtype">GUINT </td>
|
|
<td class="paramname"> <em>hashkey</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const T & </td>
|
|
<td class="paramname"> <em>element</em></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td width="100%"><code> [inline]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Insert an element into the hash, and could overrite an existing object with the same hash.
|
|
<p>
|
|
<dl class="return" compact><dt><b>Returns:</b></dt><dd>If GIM_INVALID_HASH, the object has been inserted succesfully. Else it returns the position of the replaced element. </dd></dl>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="be9a629ec7dfe612065ed9d161adc7e8"></a><!-- doxytag: member="gim_hash_table::insert_unsorted" ref="be9a629ec7dfe612065ed9d161adc7e8" args="(GUINT hashkey, const T &element)" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<class T> </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">GUINT <a class="el" href="classgim__hash__table.html">gim_hash_table</a>< T >::insert_unsorted </td>
|
|
<td>(</td>
|
|
<td class="paramtype">GUINT </td>
|
|
<td class="paramname"> <em>hashkey</em>, </td>
|
|
</tr>
|
|
<tr>
|
|
<td class="paramkey"></td>
|
|
<td></td>
|
|
<td class="paramtype">const T & </td>
|
|
<td class="paramname"> <em>element</em></td><td> </td>
|
|
</tr>
|
|
<tr>
|
|
<td></td>
|
|
<td>)</td>
|
|
<td></td><td></td><td width="100%"><code> [inline]</code></td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
Insert an element into the hash,But if this container is a sorted array, this inserts it unsorted.
|
|
<p>
|
|
|
|
</div>
|
|
</div><p>
|
|
<hr><h2>Member Data Documentation</h2>
|
|
<a class="anchor" name="da83cac38bcf3fd282287f463def04e4"></a><!-- doxytag: member="gim_hash_table::m_nodes" ref="da83cac38bcf3fd282287f463def04e4" args="" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<class T> </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname"><a class="el" href="classgim__array.html">gim_array</a>< <a class="el" href="struct_g_i_m___h_a_s_h___t_a_b_l_e___n_o_d_e.html">_node_type</a> > <a class="el" href="classgim__hash__table.html">gim_hash_table</a>< T >::<a class="el" href="classgim__hash__table.html#da83cac38bcf3fd282287f463def04e4">m_nodes</a><code> [protected]</code> </td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
The nodes.
|
|
<p>
|
|
|
|
</div>
|
|
</div><p>
|
|
<a class="anchor" name="defa6197dfd5c1564969b38d4d27848b"></a><!-- doxytag: member="gim_hash_table::m_sorted" ref="defa6197dfd5c1564969b38d4d27848b" args="" -->
|
|
<div class="memitem">
|
|
<div class="memproto">
|
|
<div class="memtemplate">
|
|
template<class T> </div>
|
|
<table class="memname">
|
|
<tr>
|
|
<td class="memname">bool <a class="el" href="classgim__hash__table.html">gim_hash_table</a>< T >::<a class="el" href="classgim__hash__table.html#defa6197dfd5c1564969b38d4d27848b">m_sorted</a><code> [protected]</code> </td>
|
|
</tr>
|
|
</table>
|
|
</div>
|
|
<div class="memdoc">
|
|
|
|
<p>
|
|
|
|
</div>
|
|
</div><p>
|
|
<hr>The documentation for this class was generated from the following file:<ul>
|
|
<li>C:/desarrollo/GIMPACT/GIMPACT/include/GIMPACT/core/<a class="el" href="gim__hash__table_8h.html">gim_hash_table.h</a></ul>
|
|
<hr size="1"><address style="text-align: right;"><small>Generated on Wed Jun 13 16:58:22 2007 for GIMPACT by
|
|
<a href="http://www.doxygen.org/index.html">
|
|
<img src="doxygen.png" alt="doxygen" align="middle" border="0"></a> 1.5.2 </small></address>
|
|
</body>
|
|
</html>
|