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
|
<!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::SimpleHashTable</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 < class Key, class Value, class KeyHashFunction = HashFunction < Key > ></h1>
<h1 class="symbol">class SimpleHashTable</h1>
</div>
<div class="body">
<p>
<b>Library:</b> Foundation<br />
<b>Package:</b> Hashing<br />
<b>Header:</b> Poco/SimpleHashTable.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.SimpleHashTable.html" title="class Poco::SimpleHashTable">SimpleHashTable</a> stores a key value pair that can be looked up via a hashed key. </p>
<p>In comparision to a <a href="Poco.HashTable.html" title="class Poco::HashTable">HashTable</a>, this class handles collisions by sequentially searching the next free location. This also means that the maximum size of this table is limited, i.e. if the hash table is full, it will throw an exception and that this class does not support remove operations. On the plus side it is faster than the <a href="Poco.HashTable.html" title="class Poco::HashTable">HashTable</a>. </p>
<p>This class is NOT thread safe. </p>
</div>
<h2>Member Summary</h2>
<p><b>Member Functions: </b><a href="Poco.SimpleHashTable.html#10156" title="Poco::SimpleHashTable::capacity()">capacity</a>, <a href="Poco.SimpleHashTable.html#10112" title="Poco::SimpleHashTable::clear()">clear</a>, <a href="Poco.SimpleHashTable.html#10159" title="Poco::SimpleHashTable::currentState()">currentState</a>, <a href="Poco.SimpleHashTable.html#10150" title="Poco::SimpleHashTable::exists()">exists</a>, <a href="Poco.SimpleHashTable.html#10152" title="Poco::SimpleHashTable::existsRaw()">existsRaw</a>, <a href="Poco.SimpleHashTable.html#10129" title="Poco::SimpleHashTable::get()">get</a>, <a href="Poco.SimpleHashTable.html#10140" title="Poco::SimpleHashTable::getKeyRaw()">getKeyRaw</a>, <a href="Poco.SimpleHashTable.html#10131" title="Poco::SimpleHashTable::getRaw()">getRaw</a>, <a href="Poco.SimpleHashTable.html#10127" title="Poco::SimpleHashTable::hash()">hash</a>, <a href="Poco.SimpleHashTable.html#10113" title="Poco::SimpleHashTable::insert()">insert</a>, <a href="Poco.SimpleHashTable.html#10116" title="Poco::SimpleHashTable::insertRaw()">insertRaw</a>, <a href="Poco.SimpleHashTable.html#10136" title="Poco::SimpleHashTable::operator()">operator</a>, <a href="Poco.SimpleHashTable.html#10108" title="Poco::SimpleHashTable::operator =()">operator =</a>, <a href="Poco.SimpleHashTable.html#10157" title="Poco::SimpleHashTable::resize()">resize</a>, <a href="Poco.SimpleHashTable.html#10155" title="Poco::SimpleHashTable::size()">size</a>, <a href="Poco.SimpleHashTable.html#10110" title="Poco::SimpleHashTable::swap()">swap</a>, <a href="Poco.SimpleHashTable.html#10120" title="Poco::SimpleHashTable::update()">update</a>, <a href="Poco.SimpleHashTable.html#10123" title="Poco::SimpleHashTable::updateRaw()">updateRaw</a></p>
<h2>Nested Classes</h2>
<h3><a href="Poco.SimpleHashTable.HashEntry.html" class="class">class HashEntry</a></h3>
<p> <a href="Poco.SimpleHashTable.HashEntry.html"><img src="images/arrow.gif" alt="more..." style="vertical-align:baseline;" border="0" /> </a></p>
<h2>Types</h2>
<h3><a name="10102">HashTableVector</a></h3>
<p class="decl">typedef std::vector < <a href="Poco.SimpleHashTable.HashEntry.html" title="class Poco::SimpleHashTable::HashEntry">HashEntry</a> * > <a href="Poco.SimpleHashTable.html#10102" title="Poco::SimpleHashTable::HashTableVector">HashTableVector</a>;</p>
<div class="description">
<p></p>
</div>
<h2>Constructors</h2>
<h3><a name="10103">SimpleHashTable</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl"><a href="Poco.SimpleHashTable.html" title="class Poco::SimpleHashTable">SimpleHashTable</a>(<br /> <a href="Poco.html#11354" title="Poco::UInt32">UInt32</a> capacity = 251<br />);</p>
<div class="description">
<p>Creates the <a href="Poco.SimpleHashTable.html" title="class Poco::SimpleHashTable">SimpleHashTable</a>. </p>
</div>
<h3><a name="10105">SimpleHashTable</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl"><a href="Poco.SimpleHashTable.html" title="class Poco::SimpleHashTable">SimpleHashTable</a>(<br /> const <a href="Poco.SimpleHashTable.html" title="class Poco::SimpleHashTable">SimpleHashTable</a> & ht<br />);</p>
<div class="description">
<p></p>
</div>
<h2>Destructor</h2>
<h3><a name="10107">~SimpleHashTable</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">~<a href="Poco.SimpleHashTable.html" title="class Poco::SimpleHashTable">SimpleHashTable</a>();</p>
<div class="description">
<p>Destroys the <a href="Poco.SimpleHashTable.html" title="class Poco::SimpleHashTable">SimpleHashTable</a>. </p>
</div>
<h2>Member Functions</h2>
<h3><a name="10156">capacity</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> capacity() const;</p>
<div class="description">
<p></p>
</div>
<h3><a name="10112">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="10159">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 /> bool details = false<br />) const;</p>
<div class="description">
<p>Returns the current internal state </p>
</div>
<h3><a name="10150">exists</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">bool exists(<br /> const Key & key<br />) const;</p>
<div class="description">
<p></p>
</div>
<h3><a name="10152">existsRaw</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">bool existsRaw(<br /> const Key & key,<br /> <a href="Poco.html#11354" title="Poco::UInt32">UInt32</a> hsh<br />) const;</p>
<div class="description">
<p></p>
</div>
<h3><a name="10129">get</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">const Value & get(<br /> const Key & key<br />) const;</p>
<div class="description">
<p>Throws an exception if the value does not exist </p>
</div>
<h3><a name="10134">get</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">Value & get(<br /> const Key & key<br />);</p>
<div class="description">
<p>Throws an exception if the value does not exist </p>
</div>
<h3><a name="10143">get</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">bool get(<br /> const Key & key,<br /> Value & 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="10140">getKeyRaw</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">const Key & getKeyRaw(<br /> const Key & key,<br /> <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="10131">getRaw</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">const Value & getRaw(<br /> const Key & key,<br /> <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="10146">getRaw</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">bool getRaw(<br /> const Key & key,<br /> <a href="Poco.html#11354" title="Poco::UInt32">UInt32</a> hsh,<br /> Value & 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="10127">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 /> const Key & key<br />) const;</p>
<div class="description">
<p></p>
</div>
<h3><a name="10113">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 /> const Key & key,<br /> const Value & 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="10116">insertRaw</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">Value & insertRaw(<br /> const Key & key,<br /> <a href="Poco.html#11354" title="Poco::UInt32">UInt32</a> hsh,<br /> const Value & 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="10136">operator</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">const Value & operator[] (<br /> const Key & key<br />) const;</p>
<div class="description">
<p></p>
</div>
<h3><a name="10138">operator</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">Value & operator[] (<br /> const Key & key<br />);</p>
<div class="description">
<p></p>
</div>
<h3><a name="10108">operator =</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl"><a href="Poco.SimpleHashTable.html" title="class Poco::SimpleHashTable">SimpleHashTable</a> & operator = (<br /> const <a href="Poco.SimpleHashTable.html" title="class Poco::SimpleHashTable">SimpleHashTable</a> & ht<br />);</p>
<div class="description">
<p></p>
</div>
<h3><a name="10157">resize</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void resize(<br /> <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="10155">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.SimpleHashTable.html" title="class Poco::SimpleHashTable">SimpleHashTable</a> </p>
</div>
<h3><a name="10110">swap</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void swap(<br /> <a href="Poco.SimpleHashTable.html" title="class Poco::SimpleHashTable">SimpleHashTable</a> & ht<br />);</p>
<div class="description">
<p></p>
</div>
<h3><a name="10120">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 /> const Key & key,<br /> const Value & 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="10123">updateRaw</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3>
<p class="decl">void updateRaw(<br /> const Key & key,<br /> <a href="Poco.html#11354" title="Poco::UInt32">UInt32</a> hsh,<br /> const Value & 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 © 2009, <a href="http://pocoproject.org/" target="_blank">Applied Informatics Software Engineering GmbH and Contributors</a></p>
</div>
</body>
</html>
|