|
Boost-Commit : |
Subject: [Boost-commit] svn:boost r72736 - in sandbox/bloom_filter/trunk/libs/bloom_filter/doc/html: reference style
From: cpp.cabrera_at_[hidden]
Date: 2011-06-24 04:28:36
Author: alejandro
Date: 2011-06-24 04:28:34 EDT (Fri, 24 Jun 2011)
New Revision: 72736
URL: http://svn.boost.org/trac/boost/changeset/72736
Log:
Updated reference to match latest implementation additions. Updated CSS to improve presentation of function reference.
Text files modified:
sandbox/bloom_filter/trunk/libs/bloom_filter/doc/html/reference/bloom.html | 138 ++++++++++++++++++++++++++++++---------
sandbox/bloom_filter/trunk/libs/bloom_filter/doc/html/style/my.css | 7 ++
2 files changed, 112 insertions(+), 33 deletions(-)
Modified: sandbox/bloom_filter/trunk/libs/bloom_filter/doc/html/reference/bloom.html
==============================================================================
--- sandbox/bloom_filter/trunk/libs/bloom_filter/doc/html/reference/bloom.html (original)
+++ sandbox/bloom_filter/trunk/libs/bloom_filter/doc/html/reference/bloom.html 2011-06-24 04:28:34 EDT (Fri, 24 Jun 2011)
@@ -43,8 +43,7 @@
<div class="listing">
<code class="c_keyword">template</code> <<code class="c_keyword">typename</code> <code class="c_id">T</code>,
<code class="c_type">size_t</code> <code class="c_id">Size</code>,
- <code class="c_keyword">class</code> <code class="c_id">HashFunctions</code> = <code class="c_namespace">mpl::vector</code><<code class="c_type">boost_hash</code><<code class="c_id">T, 3</code>>,
- <code class="c_type">boost_hash</code><<code class="c_id">T, 37</code>> > >
+ <code class="c_keyword">class</code> <code class="c_id">HashFunctions</code> = <code class="c_namespace">mpl::vector</code><<code class="c_type">boost_hash</code><<code class="c_id">T, 3</code>> > >
<code class="c_keyword">class</code> <code class="c_id">bloom_filter</code> {
<code class="c_comment">// exported typedefs</code>
<code class="c_keyword">typedef</code> <code class="c_id">T value_type</code>;
@@ -52,6 +51,10 @@
<code class="c_comment">// constructors</code>
<code class="c_func">bloom_filter</code>();
+ <code class="c_func">bloom_filter</code>(<code class="c_keyword">const</code> <code class="c_namespace">std::initializer_list</code><<code class="c_type">T</code>>&); <code class="c_comment">// requires C++11</code>
+
+ <<code class="c_keyword">typename</code> <code class="c_type">InputIterator</code>>
+ <code class="c_func">bloom_filter</code>(<code class="c_keyword">const</code> <code class="c_type">InputIterator</code> <code class="c_id">start</code>, <code class="c_keyword">const</code> <code class="c_type">InputIterator</code> <code class="c_id">end</code>);
<code class="c_comment">// data structure metadata query functions</code>
<code class="c_keyword">static constexpr</code> <code class="c_type">size_t</code> <code class="c_func">bit_capacity</code>() <code class="c_keyword">const</code>;
@@ -59,11 +62,18 @@
<code class="c_type">double</code> <code class="c_func">false_positive_rate</code>() <code class="c_keyword">const</code>;
<code class="c_type">size_t</code> <code class="c_func">count</code>() <code class="c_keyword">const</code>;
<code class="c_type">bool</code> <code class="c_func">empty</code>() <code class="c_keyword">const</code>;
- <code class="c_type">void</code> <code class="c_func">clear</code>()</code>;
<code class="c_comment">// data structures core ops</code>
<code class="c_type">void</code> <code class="c_func">insert</code>(<code class="c_keyword">const</code> <code class="c_type">T</code>&);
- <code class="c_type">bool</code> <code class="c_func">contains</code>(<code class="c_keyword">const</code> <code class="c_type">T</code>&) <code class="c_keyword">const</code>;
+
+ <<code class="c_keyword">typename</code> <code class="c_type">InputIterator</code>>
+ <code class="c_type">void</code> <code class="c_func">insert</code>(<code class="c_keyword">const</code> <code class="c_type">InputIterator</code> <code class="c_id">start</code>, <code class="c_keyword">const</code> <code class="c_type">InputIterator</code> <code class="c_id">end</code>);
+
+ <code class="c_type">bool</code> <code class="c_func">probably_contains</code>(<code class="c_keyword">const</code> <code class="c_type">T</code>&) <code class="c_keyword">const</code>;
+
+ <code class="c_comment">// auxilliary ops</code>
+ <code class="c_type">void</code> <code class="c_func">clear</code>();
+ <code class="c_type">void</code> <code class="c_func">swap</code>(<code class="c_type">bloom_filter</code>&);
<code class="c_comment">// union assign/intersect assign</code>
<code class="c_type">bloom_filter</code>& <code class="c_func">operator|=</code>(<code class="c_keyword">const</code> <code class="c_type">bloom_filter</code>&);
@@ -83,10 +93,20 @@
<code class="c_type">bloom_filter</code><<code class="c_id">T, Size, HashFunctions</code>>
<code class="c_func">operator&</code>(<code class="c_keyword">const</code> <code class="c_type">bloom_filter</code><<code class="c_id">T, Size, HashFunctions</code>>& <code class="c_id">lhs</code>,
<code class="c_keyword">const</code> <code class="c_type">bloom_filter</code><<code class="c_id">T, Size, HashFunctions</code>>& <code class="c_id">rhs</code>);
+
+ <code class="c_keyword">template</code> <<code class="c_keyword">typename</code> <code class="c_id">T</code>, <code class="c_type">size_t</code> <code class="c_id">Size</code>,
+ <code class="c_keyword">class</code> <code class="c_id">HashFunctions</code>>
+ <code class="c_type">void</code> <code class="c_func">swap</code>(<code class="c_type">bloom_filter</code><<code class="c_id">T, Size, HashFunctions</code>>& <code class="c_id">lhs</code>,
+ <code class="c_type">bloom_filter</code><<code class="c_id">T, Size, HashFunctions</code>>& <code class="c_id">rhs</code>);
</div>
<p>
- The basic Bloom filter data structure. Supports insertion and query.
+ The basic Bloom filter data structure. Supports insertion and query. Allows setting of bit capacity, type, and hash functions at compile-time. This structure is best used when:
</p>
+ <ul>
+ <li>element removal is not needed</li>
+ <li>the number of insertions can be reliably upper-bounded ahead of time</li>
+ <li>storage requirements are strict</li>
+ </ul>
<h2> Template Parameters Reference</h2>
<dl>
@@ -101,27 +121,32 @@
<div class="toc">
<p>Function Reference</p>
<ul>
- <li>bloom_filter()</li>
+ <li>bloom_filter()</li>
+ <li>bloom_filter(start, end)</li>
+ <li>bloom_filter(initializer_list)</li>
<li>bit_capacity()</li>
<li>num_hash_functions()</li>
<li>false_positive_rate()</li>
<li>empty()</li>
<li>count()</li>
+ <li>insert(T)</li>
+ <li>insert(start, end)</li>
+ <li>probably_contains(T)</li>
<li>clear()</li>
- <li>insert()</li>
- <li>probably_contains()</li>
- <li>operator|=()</li>
- <li>operator&=()</li>
- <li>operator|()</li>
- <li>operator&()</li>
+ <li>swap(bloom)</li>
+ <li>operator|=(bloom)</li>
+ <li>operator&=(bloom)</li>
+ <li>operator|(bloom, bloom)</li>
+ <li>operator&(bloom, bloom)</li>
+ <li>swap(bloom, bloom)</li>
</ul>
</div>
<br/>
<div class="func_ref">
- <a name="constructor"></a>
- <h3><code class="c_func">bloom_filter</code>()</h3>
+ <a name="default_constructor"></a>
+ <div class="ref_listing"><code class="c_func">bloom_filter</code>();</div>
<dl>
<dt>Description</dt>
<dd>Constructs a bloom_filter object with all bits set to 0.</dd>
@@ -129,8 +154,28 @@
</div>
<div class="func_ref">
+ <a name="range_constructor"></a>
+ <div class="ref_listing"><code class="c_func">bloom_filter</code>(<code class="c_keyword">const</code> <code class="c_type">InputIterator</code> <code class="c_id">start</code>, <code class="c_keyword">const</code> <code class="c_type">InputIterator</code> <code class="c_id">end</code>);</div>
+ <dl>
+ <dt>Description</dt>
+ <dd>Constructs a bloom_filter by inserting all the elements in the range (start, end).</dd>
+ </dl>
+ </div>
+
+ <div class="func_ref">
+ <a name="ilist_constructor"></a>
+ <div class="ref_listing"><code class="c_func">bloom_filter</code>(<code class="c_keyword">const</code> <code class="c_namespace">std::initializer</code><<code class="c_type">T</code>>&);</div>
+ <dl>
+ <dt>Description</dt>
+ <dd>Constructs a bloom_filter by inserting all elements in the initializer list.</dd>
+ <dt>Warning</dt>
+ <dd>Only available in C++11-supporting compilers.</dd>
+ </dl>
+ </div>
+
+ <div class="func_ref">
<a name="bit_capacity"></a>
- <h3><code class="c_type">size_t</code> <code class="c_func">bit_capacity</code>() <code class="c_keyword">const</code></h3>
+ <div class="ref_listing"><code class="c_type">size_t</code> <code class="c_func">bit_capacity</code>() <code class="c_keyword">const</code>;</div>
<dl>
<dt>Description</dt>
<dd>Returns the number of bits used internally by the Bloom filter..</dd>
@@ -142,7 +187,7 @@
<div class="func_ref">
<a name="num_hash_functions"></a>
- <h3><code class="c_type">size_t</code><code class="c_func"> num_hash_functions</code>()<code class="c_keyword"> const</code></h3>
+ <div class="ref_listing"><code class="c_type">size_t</code><code class="c_func"> num_hash_functions</code>()<code class="c_keyword"> const</code>;</div>
<dl>
<dt>Description</dt>
<dd>Returns the number of hash functions used by the Bloom filter.</dd>
@@ -153,7 +198,7 @@
<div class="func_ref">
<a name="false_positive_rate"></a>
- <h3><code class="c_type">double </code><code class="c_func">false_positive_rate</code>() <code class="c_keyword">const</code></h3>
+ <div class="ref_listing"><code class="c_type">double </code><code class="c_func">false_positive_rate</code>() <code class="c_keyword">const</code>;</div>
<dl>
<dt>Description</dt>
<dd>Returns the current false positive rate based upon the number of hash functions used (k), the number of bits available (m), and the number of bits set (n).</dd>
@@ -164,7 +209,7 @@
<div class="func_ref">
<a name="empty"></a>
- <h3><code class="c_type">bool</code> <code class="c_func">empty</code>() <code class="c_keyword">const</code></h3>
+ <div class="ref_listing"><code class="c_type">bool</code> <code class="c_func">empty</code>() <code class="c_keyword">const</code>;</div>
<dl>
<dt>Description</dt>
<dd>Returns true if no elements have been inserted into the Bloom filter.</dd>
@@ -175,7 +220,7 @@
<div class="func_ref">
<a name="count"></a>
- <h3><code class="c_type">size_t</code> <code class="c_func">count</code>() <code class="c_keyword">const</code></h3>
+ <div class="ref_listing"><code class="c_type">size_t</code> <code class="c_func">count</code>() <code class="c_keyword">const</code>;</div>
<dl>
<dt>Description</dt>
<dd>Returns the number of bits currently set in the Bloom filter.</dd>
@@ -185,31 +230,30 @@
</div>
<div class="func_ref">
- <a name="clear"></a>
- <h3><code class="c_type">void</code> <code class="c_func">clear</code>()</h3>
+ <a name="insert"></a>
+ <div class="ref_listing"><code class="c_type">void</code> <code class="c_func">insert</code>(<code class="c_keyword">const</code> <code class="c_type">T&</code>);</div>
<dl>
<dt>Description</dt>
- <dd>Sets all bits in the Bloom filter to 0, effectively canceling all insertions.</dd>
+ <dd>Inserts an element into the Bloom filter.</dd>
<dt>Post-condition</dt>
- <dd>this->count() == 0</dd>
+ <dd>At least 1 bit and at most num_hash_functions() bits of the Bloom filter will have been set.</dd>
</dl>
</div>
<div class="func_ref">
- <a name="insert"></a>
- <h3><code class="c_type">void</code> <code class="c_func">insert</code>(<code class="c_keyword">const</code> <code class="c_type">T&</code>)</h3>
+ <a name="range_insert"></a>
+ <div class="ref_listing"><code class="c_type">void</code> <code class="c_func">insert</code>(<code class="c_keyword">const</code> <code class="c_type">InputIterator</code> <code class="c_id">start</code>, <code class="c_keyword">const</code> <code class="c_type">InputIterator</code> <code class="c_id">end</code>);</div>
<dl>
<dt>Description</dt>
- <dd>Inserts an element into the Bloom filter.</dd>
+ <dd>Inserts all elements in range (start, end).</dd>
<dt>Post-condition</dt>
- <dd>At least 1 bit and at most num_hash_functions() bits of the Bloom filter will have been set.</dd>
+ <dd>At least n bits and at most (n * num_hash_functions()) bits of the Bloom filter will have been set, where n = distance(start, end).</dd>
</dl>
</div>
-
<div class="func_ref">
<a name="probably_contains"></a>
- <h3><code class="c_type">bool</code> <code class="c_func">probably_contains</code>(<code class="c_keyword">const</code> <code class="c_type">T&</code>) <code class="c_keyword">const</code></h3>
+ <div class="ref_listing"><code class="c_type">bool</code> <code class="c_func">probably_contains</code>(<code class="c_keyword">const</code> <code class="c_type">T&</code>) <code class="c_keyword">const</code>;</div>
<dl>
<dt>Description</dt>
<dd>Queries an element in the Bloom filter, checking each hash function value against the set bits.</dd>
@@ -220,10 +264,29 @@
</dl>
</div>
+ <div class="func_ref">
+ <a name="clear"></a>
+ <div class="ref_listing"><code class="c_type">void</code> <code class="c_func">clear</code>();</div>
+ <dl>
+ <dt>Description</dt>
+ <dd>Sets all bits in the Bloom filter to 0, effectively canceling all insertions.</dd>
+ <dt>Post-condition</dt>
+ <dd>this->count() == 0</dd>
+ </dl>
+ </div>
+
+ <div class="func_ref">
+ <a name="swap"></a>
+ <div class="ref_listing"><code class="c_type">void</code> <code class="c_func">swap</code>(<code class="c_type">bloom_filter</code>&);</div>
+ <dl>
+ <dt>Description</dt>
+ <dd>Swaps the bits in this Bloom filter with the argument Bloom filter.</dd>
+ </dl>
+ </div>
<div class="func_ref">
<a name="union_assign"></a>
- <h3><code class="c_type">bloom_filter&</code> <code class="c_func">operator|=</code>(<code class="c_keyword">const</code> <code class="c_type">bloom_filter&</code>)</h3>
+ <div class="ref_listing"><code class="c_type">bloom_filter&</code> <code class="c_func">operator|=</code>(<code class="c_keyword">const</code> <code class="c_type">bloom_filter&</code>);</div>
<dl>
<dt>Description</dt>
<dd>Performs a union.</dd>
@@ -236,7 +299,7 @@
<div class="func_ref">
<a name="intersect_assign"></a>
- <h3><code class="c_type">bloom_filter&</code> <code class="c_func">operator&=</code>(<code class="c_keyword">const</code> <code class="c_type">bloom_filter&</code>)</h3>
+ <div class="ref_listing"><code class="c_type">bloom_filter&</code> <code class="c_func">operator&=</code>(<code class="c_keyword">const</code> <code class="c_type">bloom_filter&</code>);</div>
<dl>
<dt>Description</dt>
<dd>Performs an intersection.</dd>
@@ -249,7 +312,7 @@
<div class="func_ref">
<a name="union"></a>
- <h3><code class="c_type">bloom_filter&</code> <code class="c_func">operator|</code>(<code class="c_keyword">const</code> <code class="c_type">bloom_filter&</code> <code class="c_id">lhs</code>, <code class="c_keyword">const</code> <code class="c_type">bloom_filter&</code> <code class="c_id">rhs</code>)</h3>
+ <div class="ref_listing"><code class="c_type">bloom_filter&</code> <code class="c_func">operator|</code>(<code class="c_keyword">const</code> <code class="c_type">bloom_filter&</code> <code class="c_id">lhs</code>, <code class="c_keyword">const</code> <code class="c_type">bloom_filter&</code> <code class="c_id">rhs</code>);</div>
<dl>
<dt>Description</dt>
<dd>Performs a union.</dd>
@@ -262,7 +325,7 @@
<div class="func_ref">
<a name="intersect"></a>
- <h3><code class="c_type">bloom_filter&</code> <code class="c_func">operator&</code>(<code class="c_keyword">const</code> <code class="c_type">bloom_filter&</code> <code class="c_id">lhs</code>, <code class="c_keyword">const</code> <code class="c_type">bloom_filter&</code> <code class="c_id">rhs</code>)</h3>
+ <div class="ref_listing"><code class="c_type">bloom_filter&</code> <code class="c_func">operator&</code>(<code class="c_keyword">const</code> <code class="c_type">bloom_filter&</code> <code class="c_id">lhs</code>, <code class="c_keyword">const</code> <code class="c_type">bloom_filter&</code> <code class="c_id">rhs</code>);</div>
<dl>
<dt>Description</dt>
<dd>Performs an intersection.</dd>
@@ -273,6 +336,15 @@
</dl>
</div>
+ <div class="func_ref">
+ <a name="global_swap"></a>
+ <div class="ref_listing"><code class="c_type">void</code> <code class="c_func">swap</code>(<code class="c_type">bloom_filter</code>&, <code class="c_type">bloom_filter</code>&);</div>
+ <dl>
+ <dt>Description</dt>
+ <dd>Swaps the bits between the argument Bloom filters.</dd>
+ </dl>
+ </div>
+
<hr/>
<div class="spirit-nav">
Modified: sandbox/bloom_filter/trunk/libs/bloom_filter/doc/html/style/my.css
==============================================================================
--- sandbox/bloom_filter/trunk/libs/bloom_filter/doc/html/style/my.css (original)
+++ sandbox/bloom_filter/trunk/libs/bloom_filter/doc/html/style/my.css 2011-06-24 04:28:34 EDT (Fri, 24 Jun 2011)
@@ -55,9 +55,16 @@
}
.func_ref dt {
+ margin: 0 1%;
font-weight: bold;
}
+.ref_listing {
+ font-family: monospace;
+ font-size: 1.2em;
+ margin: 0 1%;
+}
+
.example_output {
white-space: pre;
font-family: monospace;
Boost-Commit list run by bdawes at acm.org, david.abrahams at rcn.com, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk