File: Poco.HashTable.html

package info (click to toggle)
poco-doc 1.3.6-1
  • links: PTS
  • area: main
  • in suites: buster, jessie, jessie-kfreebsd, squeeze, stretch, wheezy
  • size: 10,076 kB
  • ctags: 9,611
  • sloc: makefile: 31
file content (195 lines) | stat: -rw-r--r-- 15,209 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Class Poco::HashTable</title>
<meta http-equiv="content-type" content="text/html; charset=utf-8"/>
<meta name="author" content="Applied Informatics Software Engineering GmbH and Contributors"/>
<meta name="publisher" content="Applied Informatics Software Engineering GmbH and Contributors"/>
<meta name="copyright" content="Copyright (c) 2009, Applied Informatics Software Engineering GmbH and Contributors"/>
<meta name="language" content="en"/>
<meta name="date" content="2009-11-24"/>
<meta name="generator" content="PocoDoc"/>
<link rel="stylesheet" href="css/styles.css" type="text/css"/>
</head>
<body bgcolor="#ffffff" leftmargin="0" topmargin="0">
<div class="header">
<h1 class="namespace"><a href="Poco.html" class="namespace">Poco</a></h1>
<h1 class="template">template &lt; class Key, class Value, class KeyHashFunction = HashFunction &lt; Key &gt; &gt;</h1>
<h1 class="symbol">class HashTable</h1>
</div>
<div class="body">
<p>
<b>Library:</b> Foundation<br />
<b>Package:</b> Hashing<br />
<b>Header:</b> Poco/HashTable.h</p>
<div class="description">
<p><b>Deprecated.</b> <i>This class is deprecated and should no longer be used.</i></p>
</div>
<h2>Description</h2>
<div class="description">
<p>A <a href="Poco.HashTable.html" title="class Poco::HashTable">HashTable</a> stores a key value pair that can be looked up via a hashed key. </p>
<p>Collision handling is done via overflow maps(!). With small hash tables performance of this data struct will be closer to that a map than a hash table, i.e. slower. On the plus side, this class offers remove operations. Also <a href="Poco.HashTable.html" title="class Poco::HashTable">HashTable</a> full errors are not possible. If a fast <a href="Poco.HashTable.html" title="class Poco::HashTable">HashTable</a> implementation is needed and the remove operation is not required, use <a href="Poco.SimpleHashTable.html" title="class Poco::SimpleHashTable">SimpleHashTable</a> instead. </p>
<p>This class is NOT thread safe. </p>
</div>
<h2>Member Summary</h2>
<p><b>Member Functions: </b><a href="Poco.HashTable.html#7465" title="Poco::HashTable::clear()">clear</a>, <a href="Poco.HashTable.html#7517" title="Poco::HashTable::currentState()">currentState</a>, <a href="Poco.HashTable.html#7508" title="Poco::HashTable::exists()">exists</a>, <a href="Poco.HashTable.html#7510" title="Poco::HashTable::existsRaw()">existsRaw</a>, <a href="Poco.HashTable.html#7487" title="Poco::HashTable::get()">get</a>, <a href="Poco.HashTable.html#7498" title="Poco::HashTable::getKeyRaw()">getKeyRaw</a>, <a href="Poco.HashTable.html#7489" title="Poco::HashTable::getRaw()">getRaw</a>, <a href="Poco.HashTable.html#7485" title="Poco::HashTable::hash()">hash</a>, <a href="Poco.HashTable.html#7466" title="Poco::HashTable::insert()">insert</a>, <a href="Poco.HashTable.html#7469" title="Poco::HashTable::insertRaw()">insertRaw</a>, <a href="Poco.HashTable.html#7514" title="Poco::HashTable::maxCapacity()">maxCapacity</a>, <a href="Poco.HashTable.html#7494" title="Poco::HashTable::operator()">operator</a>, <a href="Poco.HashTable.html#7463" title="Poco::HashTable::operator =()">operator&nbsp;=</a>, <a href="Poco.HashTable.html#7480" title="Poco::HashTable::remove()">remove</a>, <a href="Poco.HashTable.html#7482" title="Poco::HashTable::removeRaw()">removeRaw</a>, <a href="Poco.HashTable.html#7515" title="Poco::HashTable::resize()">resize</a>, <a href="Poco.HashTable.html#7513" title="Poco::HashTable::size()">size</a>, <a href="Poco.HashTable.html#7473" title="Poco::HashTable::update()">update</a>, <a href="Poco.HashTable.html#7476" title="Poco::HashTable::updateRaw()">updateRaw</a></p>
<h2>Types</h2>
<h3><a name="7456">ConstIterator</a></h3>
<p class="decl">typedef typename HashEntryMap::const_iterator <a href="Poco.HashTable.html#7456" title="Poco::HashTable::ConstIterator">ConstIterator</a>;</p>
<div class="description">
<p></p>
</div>
<h3><a name="7454">HashEntryMap</a></h3>
<p class="decl">typedef std::map &lt; Key, Value &gt; <a href="Poco.HashTable.html#7454" title="Poco::HashTable::HashEntryMap">HashEntryMap</a>;</p>
<div class="description">
<p></p>
</div>
<h3><a name="7455">HashTableVector</a></h3>
<p class="decl">typedef <a href="Poco.HashTable.html#7454" title="Poco::HashTable::HashEntryMap">HashEntryMap</a> * * <a href="Poco.HashTable.html#7455" title="Poco::HashTable::HashTableVector">HashTableVector</a>;</p>
<div class="description">
<p></p>
</div>
<h3><a name="7457">Iterator</a></h3>
<p class="decl">typedef typename HashEntryMap::iterator <a href="Poco.HashTable.html#7457" title="Poco::HashTable::Iterator">Iterator</a>;</p>
<div class="description">
<p></p>
</div>
<h2>Constructors</h2>
<h3><a name="7458">HashTable</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl"><a href="Poco.HashTable.html" title="class Poco::HashTable">HashTable</a>(<br />&nbsp;&nbsp;&nbsp;&nbsp;<a href="Poco.html#11354" title="Poco::UInt32">UInt32</a> initialSize = 251<br />);</p>
<div class="description">
<p>Creates the <a href="Poco.HashTable.html" title="class Poco::HashTable">HashTable</a>. </p>
</div>
<h3><a name="7460">HashTable</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl"><a href="Poco.HashTable.html" title="class Poco::HashTable">HashTable</a>(<br />&nbsp;&nbsp;&nbsp;&nbsp;const <a href="Poco.HashTable.html" title="class Poco::HashTable">HashTable</a> &amp; ht<br />);</p>
<div class="description">
<p></p>
</div>
<h2>Destructor</h2>
<h3><a name="7462">~HashTable</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">~<a href="Poco.HashTable.html" title="class Poco::HashTable">HashTable</a>();</p>
<div class="description">
<p>Destroys the <a href="Poco.HashTable.html" title="class Poco::HashTable">HashTable</a>. </p>
</div>
<h2>Member Functions</h2>
<h3><a name="7465">clear</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void clear();</p>
<div class="description">
<p></p>
</div>
<h3><a name="7517">currentState</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl"><a href="Poco.HashStatistic.html" title="class Poco::HashStatistic">HashStatistic</a> currentState(<br />&nbsp;&nbsp;&nbsp;&nbsp;bool details = false<br />) const;</p>
<div class="description">
<p>Returns the current internal state </p>
</div>
<h3><a name="7508">exists</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">bool exists(<br />&nbsp;&nbsp;&nbsp;&nbsp;const Key &amp; key<br />);</p>
<div class="description">
<p></p>
</div>
<h3><a name="7510">existsRaw</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">bool existsRaw(<br />&nbsp;&nbsp;&nbsp;&nbsp;const Key &amp; key,<br />&nbsp;&nbsp;&nbsp;&nbsp;<a href="Poco.html#11354" title="Poco::UInt32">UInt32</a> hsh<br />);</p>
<div class="description">
<p></p>
</div>
<h3><a name="7487">get</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">const Value &amp; get(<br />&nbsp;&nbsp;&nbsp;&nbsp;const Key &amp; key<br />) const;</p>
<div class="description">
<p>Throws an exception if the value does not exist </p>
</div>
<h3><a name="7492">get</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">Value &amp; get(<br />&nbsp;&nbsp;&nbsp;&nbsp;const Key &amp; key<br />);</p>
<div class="description">
<p>Throws an exception if the value does not exist </p>
</div>
<h3><a name="7501">get</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">bool get(<br />&nbsp;&nbsp;&nbsp;&nbsp;const Key &amp; key,<br />&nbsp;&nbsp;&nbsp;&nbsp;Value &amp; v<br />) const;</p>
<div class="description">
<p>Sets v to the found value, returns false if no value was found </p>
</div>
<h3><a name="7498">getKeyRaw</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">const Key &amp; getKeyRaw(<br />&nbsp;&nbsp;&nbsp;&nbsp;const Key &amp; key,<br />&nbsp;&nbsp;&nbsp;&nbsp;<a href="Poco.html#11354" title="Poco::UInt32">UInt32</a> hsh<br />);</p>
<div class="description">
<p>Throws an exception if the key does not exist. returns a reference to the internally stored key. Useful when someone does an insert and wants for performance reason only to store a pointer to the key in another collection </p>
</div>
<h3><a name="7489">getRaw</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">const Value &amp; getRaw(<br />&nbsp;&nbsp;&nbsp;&nbsp;const Key &amp; key,<br />&nbsp;&nbsp;&nbsp;&nbsp;<a href="Poco.html#11354" title="Poco::UInt32">UInt32</a> hsh<br />) const;</p>
<div class="description">
<p>Throws an exception if the value does not exist </p>
</div>
<h3><a name="7504">getRaw</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">bool getRaw(<br />&nbsp;&nbsp;&nbsp;&nbsp;const Key &amp; key,<br />&nbsp;&nbsp;&nbsp;&nbsp;<a href="Poco.html#11354" title="Poco::UInt32">UInt32</a> hsh,<br />&nbsp;&nbsp;&nbsp;&nbsp;Value &amp; v<br />) const;</p>
<div class="description">
<p>Sets v to the found value, returns false if no value was found </p>
</div>
<h3><a name="7485">hash</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl"><a href="Poco.html#11354" title="Poco::UInt32">UInt32</a> hash(<br />&nbsp;&nbsp;&nbsp;&nbsp;const Key &amp; key<br />) const;</p>
<div class="description">
<p></p>
</div>
<h3><a name="7466">insert</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl"><a href="Poco.html#11354" title="Poco::UInt32">UInt32</a> insert(<br />&nbsp;&nbsp;&nbsp;&nbsp;const Key &amp; key,<br />&nbsp;&nbsp;&nbsp;&nbsp;const Value &amp; value<br />);</p>
<div class="description">
<p>Returns the hash value of the inserted item. Throws an exception if the entry was already inserted </p>
</div>
<h3><a name="7469">insertRaw</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">Value &amp; insertRaw(<br />&nbsp;&nbsp;&nbsp;&nbsp;const Key &amp; key,<br />&nbsp;&nbsp;&nbsp;&nbsp;<a href="Poco.html#11354" title="Poco::UInt32">UInt32</a> hsh,<br />&nbsp;&nbsp;&nbsp;&nbsp;const Value &amp; value<br />);</p>
<div class="description">
<p>Returns the hash value of the inserted item. Throws an exception if the entry was already inserted </p>
</div>
<h3><a name="7514">maxCapacity</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl"><a href="Poco.html#11354" title="Poco::UInt32">UInt32</a> maxCapacity() const;</p>
<div class="description">
<p></p>
</div>
<h3><a name="7494">operator</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">const Value &amp; operator[] (<br />&nbsp;&nbsp;&nbsp;&nbsp;const Key &amp; key<br />) const;</p>
<div class="description">
<p></p>
</div>
<h3><a name="7496">operator</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">Value &amp; operator[] (<br />&nbsp;&nbsp;&nbsp;&nbsp;const Key &amp; key<br />);</p>
<div class="description">
<p></p>
</div>
<h3><a name="7463">operator =</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl"><a href="Poco.HashTable.html" title="class Poco::HashTable">HashTable</a> &amp; operator = (<br />&nbsp;&nbsp;&nbsp;&nbsp;const <a href="Poco.HashTable.html" title="class Poco::HashTable">HashTable</a> &amp; ht<br />);</p>
<div class="description">
<p></p>
</div>
<h3><a name="7480">remove</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void remove(<br />&nbsp;&nbsp;&nbsp;&nbsp;const Key &amp; key<br />);</p>
<div class="description">
<p></p>
</div>
<h3><a name="7482">removeRaw</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void removeRaw(<br />&nbsp;&nbsp;&nbsp;&nbsp;const Key &amp; key,<br />&nbsp;&nbsp;&nbsp;&nbsp;<a href="Poco.html#11354" title="Poco::UInt32">UInt32</a> hsh<br />);</p>
<div class="description">
<p>Performance version, allows to specify the hash value </p>
</div>
<h3><a name="7515">resize</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void resize(<br />&nbsp;&nbsp;&nbsp;&nbsp;<a href="Poco.html#11354" title="Poco::UInt32">UInt32</a> newSize<br />);</p>
<div class="description">
<p>Resizes the hashtable, rehashes all existing entries. Expensive! </p>
</div>
<h3><a name="7513">size</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">std::size_t size() const;</p>
<div class="description">
<p>Returns the number of elements already inserted into the <a href="Poco.HashTable.html" title="class Poco::HashTable">HashTable</a> </p>
</div>
<h3><a name="7473">update</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl"><a href="Poco.html#11354" title="Poco::UInt32">UInt32</a> update(<br />&nbsp;&nbsp;&nbsp;&nbsp;const Key &amp; key,<br />&nbsp;&nbsp;&nbsp;&nbsp;const Value &amp; value<br />);</p>
<div class="description">
<p>Returns the hash value of the inserted item. Replaces an existing entry if it finds one </p>
</div>
<h3><a name="7476">updateRaw</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void updateRaw(<br />&nbsp;&nbsp;&nbsp;&nbsp;const Key &amp; key,<br />&nbsp;&nbsp;&nbsp;&nbsp;<a href="Poco.html#11354" title="Poco::UInt32">UInt32</a> hsh,<br />&nbsp;&nbsp;&nbsp;&nbsp;const Value &amp; value<br />);</p>
<div class="description">
<p>Returns the hash value of the inserted item. Replaces an existing entry if it finds one </p>
</div>
<p class="footer">POCO C++ Libraries 1.3.6-all<br />
Copyright &copy; 2009, <a href="http://pocoproject.org/" target="_blank">Applied Informatics Software Engineering GmbH and Contributors</a></p>

</div>
</body>
</html>