<!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::HashSet</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 Value, class HashFunc = Hash < Value > ></h1> <h1 class="symbol">class HashSet</h1> </div> <div class="body"> <p> <b>Library:</b> Foundation<br /> <b>Package:</b> Hashing<br /> <b>Header:</b> Poco/HashSet.h</p> <h2>Description</h2> <div class="description"> <p>This class implements a set using a <a href="Poco.LinearHashTable.html" title="class Poco::LinearHashTable">LinearHashTable</a>. </p> <p>A <a href="Poco.HashSet.html" title="class Poco::HashSet">HashSet</a> can be used just like a std::set. </p> </div> <h2>Member Summary</h2> <p><b>Member Functions: </b><a href="Poco.HashSet.html#7412" title="Poco::HashSet::begin()">begin</a>, <a href="Poco.HashSet.html#7428" title="Poco::HashSet::clear()">clear</a>, <a href="Poco.HashSet.html#7420" title="Poco::HashSet::count()">count</a>, <a href="Poco.HashSet.html#7430" title="Poco::HashSet::empty()">empty</a>, <a href="Poco.HashSet.html#7413" title="Poco::HashSet::end()">end</a>, <a href="Poco.HashSet.html#7424" title="Poco::HashSet::erase()">erase</a>, <a href="Poco.HashSet.html#7416" title="Poco::HashSet::find()">find</a>, <a href="Poco.HashSet.html#7422" title="Poco::HashSet::insert()">insert</a>, <a href="Poco.HashSet.html#7408" title="Poco::HashSet::operator =()">operator =</a>, <a href="Poco.HashSet.html#7429" title="Poco::HashSet::size()">size</a>, <a href="Poco.HashSet.html#7410" title="Poco::HashSet::swap()">swap</a></p> <h2>Types</h2> <h3><a name="7401">ConstIterator</a></h3> <p class="decl">typedef typename <a href="Poco.HashTable.html#7456" title="Poco::HashTable::ConstIterator">HashTable::ConstIterator</a> <a href="Poco.HashSet.html#7401" title="Poco::HashSet::ConstIterator">ConstIterator</a>;</p> <div class="description"> <p></p> </div> <h3><a name="7397">ConstPointer</a></h3> <p class="decl">typedef const Value * <a href="Poco.HashSet.html#7397" title="Poco::HashSet::ConstPointer">ConstPointer</a>;</p> <div class="description"> <p></p> </div> <h3><a name="7395">ConstReference</a></h3> <p class="decl">typedef const Value & <a href="Poco.HashSet.html#7395" title="Poco::HashSet::ConstReference">ConstReference</a>;</p> <div class="description"> <p></p> </div> <h3><a name="7398">Hash</a></h3> <p class="decl">typedef HashFunc <a href="Poco.HashSet.html#7398" title="Poco::HashSet::Hash">Hash</a>;</p> <div class="description"> <p></p> </div> <h3><a name="7399">HashTable</a></h3> <p class="decl">typedef <a href="Poco.LinearHashTable.html" title="class Poco::LinearHashTable">LinearHashTable</a> < <a href="Poco.HashSet.html#7393" title="Poco::HashSet::ValueType">ValueType</a>, <a href="Poco.HashSet.html#7398" title="Poco::HashSet::Hash">Hash</a> > <a href="Poco.HashSet.html#7399" title="Poco::HashSet::HashTable">HashTable</a>;</p> <div class="description"> <p></p> </div> <h3><a name="7400">Iterator</a></h3> <p class="decl">typedef typename <a href="Poco.HashTable.html#7457" title="Poco::HashTable::Iterator">HashTable::Iterator</a> <a href="Poco.HashSet.html#7400" title="Poco::HashSet::Iterator">Iterator</a>;</p> <div class="description"> <p></p> </div> <h3><a name="7396">Pointer</a></h3> <p class="decl">typedef Value * <a href="Poco.HashSet.html#7396" title="Poco::HashSet::Pointer">Pointer</a>;</p> <div class="description"> <p></p> </div> <h3><a name="7394">Reference</a></h3> <p class="decl">typedef Value & <a href="Poco.HashSet.html#7394" title="Poco::HashSet::Reference">Reference</a>;</p> <div class="description"> <p></p> </div> <h3><a name="7393">ValueType</a></h3> <p class="decl">typedef Value <a href="Poco.HashSet.html#7393" title="Poco::HashSet::ValueType">ValueType</a>;</p> <div class="description"> <p></p> </div> <h2>Constructors</h2> <h3><a name="7402">HashSet</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3> <p class="decl"><a href="Poco.HashSet.html" title="class Poco::HashSet">HashSet</a>();</p> <div class="description"> <p>Creates an empty <a href="Poco.HashSet.html" title="class Poco::HashSet">HashSet</a>. </p> </div> <h3><a name="7403">HashSet</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3> <p class="decl"><a href="Poco.HashSet.html" title="class Poco::HashSet">HashSet</a>(<br /> std::size_t initialReserve<br />);</p> <div class="description"> <p>Creates the <a href="Poco.HashSet.html" title="class Poco::HashSet">HashSet</a>, using the given initialReserve. </p> </div> <h3><a name="7405">HashSet</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3> <p class="decl"><a href="Poco.HashSet.html" title="class Poco::HashSet">HashSet</a>(<br /> const <a href="Poco.HashSet.html" title="class Poco::HashSet">HashSet</a> & set<br />);</p> <div class="description"> <p>Creates the <a href="Poco.HashSet.html" title="class Poco::HashSet">HashSet</a> by copying another one. </p> </div> <h2>Destructor</h2> <h3><a name="7407">~HashSet</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3> <p class="decl">~<a href="Poco.HashSet.html" title="class Poco::HashSet">HashSet</a>();</p> <div class="description"> <p>Destroys the <a href="Poco.HashSet.html" title="class Poco::HashSet">HashSet</a>. </p> </div> <h2>Member Functions</h2> <h3><a name="7412">begin</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3> <p class="decl"><a href="Poco.HashSet.html#7401" title="Poco::HashSet::ConstIterator">ConstIterator</a> begin() const;</p> <div class="description"> <p>Returns an iterator pointing to the first entry, if one exists. </p> </div> <h3><a name="7414">begin</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3> <p class="decl"><a href="Poco.HashSet.html#7400" title="Poco::HashSet::Iterator">Iterator</a> begin();</p> <div class="description"> <p>Returns an iterator pointing to the first entry, if one exists. </p> </div> <h3><a name="7428">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>Erases all elements. </p> </div> <h3><a name="7420">count</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3> <p class="decl">std::size_t count(<br /> const <a href="Poco.HashSet.html#7393" title="Poco::HashSet::ValueType">ValueType</a> & value<br />) const;</p> <div class="description"> <p>Returns the number of elements with the given value, with is either 1 or 0. </p> </div> <h3><a name="7430">empty</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3> <p class="decl">bool empty() const;</p> <div class="description"> <p>Returns true if and only if the table is empty. </p> </div> <h3><a name="7413">end</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3> <p class="decl"><a href="Poco.HashSet.html#7401" title="Poco::HashSet::ConstIterator">ConstIterator</a> end() const;</p> <div class="description"> <p>Returns an iterator pointing to the end of the table. </p> </div> <h3><a name="7415">end</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3> <p class="decl"><a href="Poco.HashSet.html#7400" title="Poco::HashSet::Iterator">Iterator</a> end();</p> <div class="description"> <p>Returns an iterator pointing to the end of the table. </p> </div> <h3><a name="7424">erase</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3> <p class="decl">void erase(<br /> <a href="Poco.HashSet.html#7400" title="Poco::HashSet::Iterator">Iterator</a> it<br />);</p> <div class="description"> <p>Erases the element pointed to by it. </p> </div> <h3><a name="7426">erase</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3> <p class="decl">void erase(<br /> const <a href="Poco.HashSet.html#7393" title="Poco::HashSet::ValueType">ValueType</a> & value<br />);</p> <div class="description"> <p>Erases the element with the given value, if it exists. </p> </div> <h3><a name="7416">find</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3> <p class="decl"><a href="Poco.HashSet.html#7401" title="Poco::HashSet::ConstIterator">ConstIterator</a> find(<br /> const <a href="Poco.HashSet.html#7393" title="Poco::HashSet::ValueType">ValueType</a> & value<br />) const;</p> <div class="description"> <p>Finds an entry in the table. </p> </div> <h3><a name="7418">find</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3> <p class="decl"><a href="Poco.HashSet.html#7400" title="Poco::HashSet::Iterator">Iterator</a> find(<br /> const <a href="Poco.HashSet.html#7393" title="Poco::HashSet::ValueType">ValueType</a> & value<br />);</p> <div class="description"> <p>Finds an entry in the table. </p> </div> <h3><a name="7422">insert</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3> <p class="decl">std::pair < <a href="Poco.HashSet.html#7400" title="Poco::HashSet::Iterator">Iterator</a>, bool > insert(<br /> const <a href="Poco.HashSet.html#7393" title="Poco::HashSet::ValueType">ValueType</a> & value<br />);</p> <div class="description"> <p>Inserts an element into the set. </p> <p>If the element already exists in the set, a pair(iterator, false) with iterator pointing to the existing element is returned. Otherwise, the element is inserted an a pair(iterator, true) with iterator pointing to the new element is returned. </p> </div> <h3><a name="7408">operator =</a> <img src="images/inline.gif" alt="inline" title="inline" style="vertical-align:baseline;" border="0" /> </h3> <p class="decl"><a href="Poco.HashSet.html" title="class Poco::HashSet">HashSet</a> & operator = (<br /> const <a href="Poco.HashSet.html" title="class Poco::HashSet">HashSet</a> & table<br />);</p> <div class="description"> <p>Assigns another <a href="Poco.HashSet.html" title="class Poco::HashSet">HashSet</a>. </p> </div> <h3><a name="7429">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 in the table. </p> </div> <h3><a name="7410">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.HashSet.html" title="class Poco::HashSet">HashSet</a> & set<br />);</p> <div class="description"> <p>Swaps the <a href="Poco.HashSet.html" title="class Poco::HashSet">HashSet</a> with another 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>