Skip to content

Commit

Permalink
Fix pqueue4 edoc generation. Add eunit calls to tests. Add generated …
Browse files Browse the repository at this point in the history
…edoc documentation.
  • Loading branch information
okeuday committed Jul 28, 2012
1 parent 4d2f095 commit 3971b4a
Show file tree
Hide file tree
Showing 21 changed files with 1,111 additions and 20 deletions.
4 changes: 4 additions & 0 deletions doc/edoc-info
@@ -0,0 +1,4 @@
{application,pqueue}.
{packages,[]}.
{modules,[pqueue,pqueue2,pqueue3,pqueue4,pqueue_proper,priority_queue,
queue_srv]}.
Binary file added doc/erlang.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
17 changes: 17 additions & 0 deletions doc/index.html
@@ -0,0 +1,17 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>The pqueue application</title>
</head>
<frameset cols="20%,80%">
<frame src="modules-frame.html" name="modulesFrame" title="">

<frame src="overview-summary.html" name="overviewFrame" title="">
<noframes>
<h2>This page uses frames</h2>
<p>Your browser does not accept frames.
<br>You should go to the <a href="overview-summary.html">non-frame version</a> instead.
</p>
</noframes>
</frameset>
</html>
18 changes: 18 additions & 0 deletions doc/modules-frame.html
@@ -0,0 +1,18 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>The pqueue application</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="EDoc">
</head>
<body bgcolor="white">
<h2 class="indextitle">Modules</h2>
<table width="100%" border="0" summary="list of modules">
<tr><td><a href="pqueue.html" target="overviewFrame" class="module">pqueue</a></td></tr>
<tr><td><a href="pqueue2.html" target="overviewFrame" class="module">pqueue2</a></td></tr>
<tr><td><a href="pqueue3.html" target="overviewFrame" class="module">pqueue3</a></td></tr>
<tr><td><a href="pqueue4.html" target="overviewFrame" class="module">pqueue4</a></td></tr>
<tr><td><a href="pqueue_proper.html" target="overviewFrame" class="module">pqueue_proper</a></td></tr>
<tr><td><a href="priority_queue.html" target="overviewFrame" class="module">priority_queue</a></td></tr>
<tr><td><a href="queue_srv.html" target="overviewFrame" class="module">queue_srv</a></td></tr></table>
</body>
</html>
16 changes: 16 additions & 0 deletions doc/overview-summary.html
@@ -0,0 +1,16 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>The pqueue application</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="EDoc">
</head>
<body bgcolor="white">
<div class="navbar"><a name="#navbar_top"></a><table width="100%" border="0" cellspacing="0" cellpadding="2" summary="navigation bar"><tr><td><a href="overview-summary.html" target="overviewFrame">Overview</a></td><td><a href="http://www.erlang.org/"><img src="erlang.png" align="right" border="0" alt="erlang logo"></a></td></tr></table></div>
<h1>The pqueue application</h1>

<hr>
<div class="navbar"><a name="#navbar_bottom"></a><table width="100%" border="0" cellspacing="0" cellpadding="2" summary="navigation bar"><tr><td><a href="overview-summary.html" target="overviewFrame">Overview</a></td><td><a href="http://www.erlang.org/"><img src="erlang.png" align="right" border="0" alt="erlang logo"></a></td></tr></table></div>
<p><i>Generated by EDoc, Jul 27 2012, 21:15:38.</i></p>
</body>
</html>
11 changes: 11 additions & 0 deletions doc/packages-frame.html
@@ -0,0 +1,11 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<title>The pqueue application</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="EDoc">
</head>
<body bgcolor="white">
<h2 class="indextitle">Packages</h2>
<table width="100%" border="0" summary="list of packages"></table>
</body>
</html>
166 changes: 166 additions & 0 deletions doc/pqueue.html
@@ -0,0 +1,166 @@
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Module pqueue</title>
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="EDoc">
</head>
<body bgcolor="white">
<div class="navbar"><a name="#navbar_top"></a><table width="100%" border="0" cellspacing="0" cellpadding="2" summary="navigation bar"><tr><td><a href="overview-summary.html" target="overviewFrame">Overview</a></td><td><a href="http://www.erlang.org/"><img src="erlang.png" align="right" border="0" alt="erlang logo"></a></td></tr></table></div>
<hr>

<h1>Module pqueue</h1>
<ul class="index"><li><a href="#description">Description</a></li><li><a href="#types">Data Types</a></li><li><a href="#index">Function Index</a></li><li><a href="#functions">Function Details</a></li></ul>
<h3><a name="Static_Priority_Queue.">Static Priority Queue.</a></h3>
This priority queue implementation depends on a static number of priorities
(-20 (high) to 20 (low)) so that tuple access times can be exploited for
quick in/out priority queue operations.
<p>Copyright © 2011 Michael Truog</p>

<p><b>Version:</b> 0.1.9 Jul 27 2012 21:15:37
------------------------------------------------------------------------</p>
<p><b>Authors:</b> Michael Truog (<a href="mailto:mjtruog [at] gmail (dot) com"><tt>mjtruog [at] gmail (dot) com</tt></a>).</p>

<h2><a name="description">Description</a></h2>
<h3><a name="Static_Priority_Queue.">Static Priority Queue.</a></h3>
This priority queue implementation depends on a static number of priorities
(-20 (high) to 20 (low)) so that tuple access times can be exploited for
quick in/out priority queue operations. This implementation was created to
avoid the slowness within the priority queue used by both RabbitMQ and Riak
(https://github.com/basho/riak_core/blob/master/src/priority_queue.erl).
<h2><a name="types">Data Types</a></h2>

<h3 class="typedecl"><a name="type-pqueue">pqueue()</a></h3>
<p><tt>pqueue() = {integer(), {queue(), queue(), queue(), queue(), queue(), queue(), queue()}, {queue(), queue(), queue(), queue(), queue(), queue(), queue()}, {queue(), queue(), queue(), queue(), queue(), queue()}, queue(), {queue(), queue(), queue(), queue(), queue(), queue()}, {queue(), queue(), queue(), queue(), queue(), queue(), queue()}, {queue(), queue(), queue(), queue(), queue(), queue(), queue()}} | {empty, {queue(), queue(), queue(), queue(), queue(), queue(), queue()}, {queue(), queue(), queue(), queue(), queue(), queue(), queue()}, {queue(), queue(), queue(), queue(), queue(), queue()}, queue(), {queue(), queue(), queue(), queue(), queue(), queue()}, {queue(), queue(), queue(), queue(), queue(), queue(), queue()}, {queue(), queue(), queue(), queue(), queue(), queue(), queue()}}</tt></p>


<h2><a name="index">Function Index</a></h2>
<table width="100%" border="1" cellspacing="0" cellpadding="2" summary="function index"><tr><td valign="top"><a href="#in-2">in/2</a></td><td>
<h4><a name="Append_an_item_to_the_tail_of_the_0_priority_queue.">Append an item to the tail of the 0 priority queue.</a></h4>
O(1).</td></tr>
<tr><td valign="top"><a href="#in-3">in/3</a></td><td>
<h4><a name="Append_an_item_to_the_tail_of_a_specific_priority_queue.">Append an item to the tail of a specific priority queue.</a></h4>
O(1).</td></tr>
<tr><td valign="top"><a href="#is_empty-1">is_empty/1</a></td><td>
<h4><a name="Check_if_the_priority_queue_is_empty.">Check if the priority queue is empty.</a></h4>
O(1).</td></tr>
<tr><td valign="top"><a href="#is_queue-1">is_queue/1</a></td><td>
<h4><a name="Check_if_the_priority_queue_type_is_as_expected.">Check if the priority queue type is as expected.</a></h4>
O(1).</td></tr>
<tr><td valign="top"><a href="#join-2">join/2</a></td><td>
<h4><a name="Join_two_priority_queues.">Join two priority queues.</a></h4>
O(N).</td></tr>
<tr><td valign="top"><a href="#len-1">len/1</a></td><td>
<h4><a name="Determine_the_length_of_a_priority_queue.">Determine the length of a priority queue.</a></h4>
O(N).</td></tr>
<tr><td valign="top"><a href="#new-0">new/0</a></td><td>
<h4><a name="Create_a_new_priority_queue.">Create a new priority queue.</a></h4>
O(1).</td></tr>
<tr><td valign="top"><a href="#out-1">out/1</a></td><td>
<h4><a name="Take_an_item_from_the_head_of_the_priority_queue.">Take an item from the head of the priority queue.</a></h4>
O(1) amortized, O(N) worst case.</td></tr>
<tr><td valign="top"><a href="#out-2">out/2</a></td><td>
<h4><a name="Take_an_item_of_a_specific_priority_from_the_head_of_the_queue.">Take an item of a specific priority from the head of the queue.</a></h4>
O(1) amortized, O(N) worst case.</td></tr>
<tr><td valign="top"><a href="#pout-1">pout/1</a></td><td>
<h4><a name="Take_an_item_from_the_head_of_the_priority_queue.">Take an item from the head of the priority queue.</a></h4>
Includes the priority in the return value.</td></tr>
<tr><td valign="top"><a href="#test-0">test/0</a></td><td>
<h4><a name="Regression_test.">Regression test.</a></h4>.</td></tr>
<tr><td valign="top"><a href="#to_list-1">to_list/1</a></td><td>
<h4><a name="Convert_the_priority_queue_to_a_list.">Convert the priority queue to a list.</a></h4>
O(N).</td></tr>
</table>

<h2><a name="functions">Function Details</a></h2>

<h3 class="function"><a name="in-2">in/2</a></h3>
<div class="spec">
<p><tt>in(X::term(), Q::<a href="#type-pqueue">pqueue()</a>) -&gt; <a href="#type-pqueue">pqueue()</a></tt><br></p>
</div><p>
<h4><a name="Append_an_item_to_the_tail_of_the_0_priority_queue.">Append an item to the tail of the 0 priority queue.</a></h4>
O(1)</p>

<h3 class="function"><a name="in-3">in/3</a></h3>
<div class="spec">
<p><tt>in(X::term(), P::integer(), Q::<a href="#type-pqueue">pqueue()</a>) -&gt; <a href="#type-pqueue">pqueue()</a></tt><br></p>
</div><p>
<h4><a name="Append_an_item_to_the_tail_of_a_specific_priority_queue.">Append an item to the tail of a specific priority queue.</a></h4>
O(1)</p>

<h3 class="function"><a name="is_empty-1">is_empty/1</a></h3>
<div class="spec">
<p><tt>is_empty(X1::<a href="#type-pqueue">pqueue()</a>) -&gt; true | false</tt><br></p>
</div><p>
<h4><a name="Check_if_the_priority_queue_is_empty.">Check if the priority queue is empty.</a></h4>
O(1)</p>

<h3 class="function"><a name="is_queue-1">is_queue/1</a></h3>
<div class="spec">
<p><tt>is_queue(X1::<a href="#type-pqueue">pqueue()</a>) -&gt; true | false</tt><br></p>
</div><p>
<h4><a name="Check_if_the_priority_queue_type_is_as_expected.">Check if the priority queue type is as expected.</a></h4>
O(1)</p>

<h3 class="function"><a name="join-2">join/2</a></h3>
<div class="spec">
<p><tt>join(X1::<a href="#type-pqueue">pqueue()</a>, X2::<a href="#type-pqueue">pqueue()</a>) -&gt; <a href="#type-pqueue">pqueue()</a></tt><br></p>
</div><p>
<h4><a name="Join_two_priority_queues.">Join two priority queues.</a></h4>
O(N)</p>

<h3 class="function"><a name="len-1">len/1</a></h3>
<div class="spec">
<p><tt>len(X1::<a href="#type-pqueue">pqueue()</a>) -&gt; non_neg_integer()</tt><br></p>
</div><p>
<h4><a name="Determine_the_length_of_a_priority_queue.">Determine the length of a priority queue.</a></h4>
O(N)</p>

<h3 class="function"><a name="new-0">new/0</a></h3>
<div class="spec">
<p><tt>new() -&gt; <a href="#type-pqueue">pqueue()</a></tt><br></p>
</div><p>
<h4><a name="Create_a_new_priority_queue.">Create a new priority queue.</a></h4>
O(1)</p>

<h3 class="function"><a name="out-1">out/1</a></h3>
<div class="spec">
<p><tt>out(Q::<a href="#type-pqueue">pqueue()</a>) -&gt; {{value, term()}, <a href="#type-pqueue">pqueue()</a>} | {empty, <a href="#type-pqueue">pqueue()</a>}</tt><br></p>
</div><p>
<h4><a name="Take_an_item_from_the_head_of_the_priority_queue.">Take an item from the head of the priority queue.</a></h4>
O(1) amortized, O(N) worst case</p>

<h3 class="function"><a name="out-2">out/2</a></h3>
<div class="spec">
<p><tt>out(P::integer(), Q::<a href="#type-pqueue">pqueue()</a>) -&gt; {{value, term()}, <a href="#type-pqueue">pqueue()</a>} | {empty, <a href="#type-pqueue">pqueue()</a>}</tt><br></p>
</div><p>
<h4><a name="Take_an_item_of_a_specific_priority_from_the_head_of_the_queue.">Take an item of a specific priority from the head of the queue.</a></h4>
O(1) amortized, O(N) worst case</p>

<h3 class="function"><a name="pout-1">pout/1</a></h3>
<div class="spec">
<p><tt>pout(Q::<a href="#type-pqueue">pqueue()</a>) -&gt; {{value, term(), integer()}, <a href="#type-pqueue">pqueue()</a>} | {empty, <a href="#type-pqueue">pqueue()</a>}</tt><br></p>
</div><p>
<h4><a name="Take_an_item_from_the_head_of_the_priority_queue.">Take an item from the head of the priority queue.</a></h4>
Includes the priority in the return value.
O(1) amortized, O(N) worst case</p>

<h3 class="function"><a name="test-0">test/0</a></h3>
<div class="spec">
<p><tt>test() -&gt; any()</tt></p>
</div><p>
<h4><a name="Regression_test.">Regression test.</a></h4>
</p>

<h3 class="function"><a name="to_list-1">to_list/1</a></h3>
<div class="spec">
<p><tt>to_list(X1::<a href="#type-pqueue">pqueue()</a>) -&gt; [term()]</tt><br></p>
</div><p>
<h4><a name="Convert_the_priority_queue_to_a_list.">Convert the priority queue to a list.</a></h4>
O(N)</p>
<hr>

<div class="navbar"><a name="#navbar_bottom"></a><table width="100%" border="0" cellspacing="0" cellpadding="2" summary="navigation bar"><tr><td><a href="overview-summary.html" target="overviewFrame">Overview</a></td><td><a href="http://www.erlang.org/"><img src="erlang.png" align="right" border="0" alt="erlang logo"></a></td></tr></table></div>
<p><i>Generated by EDoc, Jul 27 2012, 21:15:37.</i></p>
</body>
</html>

0 comments on commit 3971b4a

Please sign in to comment.