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
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title>Qt Toolkit - QQueue Class</title><style type="text/css"><!--
h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }body { background: white; color: black; }
--></style>
</head><body bgcolor="#ffffff">
<table width="100%">
<tr><td><a href="index.html">
<img width="100" height="100" src="qtlogo.png"
alt="Home" border="0"><img width="100"
height="100" src="face.png" alt="Home" border="0">
</a><td valign=top><div align=right><img src="dochead.png" width="472" height="27"><br>
<a href="classes.html"><b>Classes</b></a>
-<a href="annotated.html">Annotated</a>
- <a href="hierarchy.html">Tree</a>
-<a href="functions.html">Functions</a>
-<a href="index.html">Home</a>
-<a href="topicals.html"><b>Structure</b></a>
</div>
</table>
<h1 align=center>QQueue Class Reference</h1><br clear="all">
<p>
The QQueue class is a template class that provides a queue.
<a href="#details">More...</a>
<p>
<code>#include <<a href="qqueue-h.html">qqueue.h</a>></code>
<p><a href="qqueue-members.html">List of all member functions.</a>
<h2>Public Members</h2>
<ul>
<li><div class="fn"><a href="#b8b70d"><b>QQueue</b></a>()</div>
<li><div class="fn"><a href="#1be70f"><b>QQueue</b></a>(constQQueue<type>&queue)</div>
<li><div class="fn"><a href="#17701e"><b>~QQueue</b></a>()</div>
<li><div class="fn">QQueue<type>&<a href="#2d5bc8"><b>operator=</b></a>(constQQueue<type>&queue)</div>
<li><div class="fn">bool<a href="#1e17ee"><b>autoDelete</b></a>()const</div>
<li><div class="fn">void<a href="#342a2b"><b>setAutoDelete</b></a>(boolenable)</div>
<li><div class="fn">virtualuint<a href="#5436fb"><b>count</b></a>()const</div>
<li><div class="fn">bool<a href="#6f4506"><b>isEmpty</b></a>()const</div>
<li><div class="fn">void<a href="#67b0b6"><b>enqueue</b></a>(consttype*d)</div>
<li><div class="fn">type*<a href="#b8b005"><b>dequeue</b></a>()</div>
<li><div class="fn">bool<a href="#876afe"><b>remove</b></a>()</div>
<li><div class="fn">virtualvoid<a href="#8f56c9"><b>clear</b></a>()</div>
<li><div class="fn">type*<a href="#bcccec"><b>head</b></a>()const</div>
<li><div class="fn">operator<a href=qqueue.html#110bb3><b>type*</b></a>()const</div>
<li><div class="fn">type*<a href="#ad2472"><b>current</b></a>()const</div>
</ul>
<hr><h2><a name="details"></a>Detailed Description</h2>
The QQueue class is a template class that provides a queue.
<p>
QQueue is implemented as a template class. Define a template
instance QQueue<X> to create a queue that operates on pointers to
X, or X*.
<p>A queue is a First In, First Out (FIFO) structure. Items are added
to the back of the queue with <a href="#67b0b6">enqueue</a>() and retrieved from the front
with <a href="#b8b005">dequeue</a>().
<p>See also <a href="collection.html">Collection Classes</a>
<hr><h2>Member Function Documentation</h2>
<h3 class="fn"><a name="b8b70d"></a>QQueue::QQueue()</h3>
<p>Creates an empty queue.
<h3 class="fn"><a name="1be70f"></a>QQueue::QQueue(constQQueue<type>&queue)</h3>
<p>Creates a queue from another.
<p>Only the pointers are copied (shallow copy).
<h3 class="fn"><a name="17701e"></a>QQueue::~QQueue()</h3>
<p>Destroys the list. Items in the list are destroyed if <a href="#1e17ee">autoDelete</a>() is TRUE.
<h3 class="fn"><a name="110bb3"></a>QQueue::operatortype*()const</h3>
<p>Returns a reference to the front item in the queue. The queue is
not changed.
<h3 class="fn">bool<a name="1e17ee"></a>QQueue::autoDelete()const</h3>
<p>The same as <a href="qcollection.html#05b849">QCollection::autoDelete</a>().
<p>See also <a href="#342a2b">setAutoDelete</a>().
<h3 class="fn">void<a name="8f56c9"></a>QQueue::clear() <code>[virtual]</code></h3>
<p>Removes all items from the queue, deleting them if
if <a href="#1e17ee">autoDelete</a>() is TRUE.
<p>See also <a href="#876afe">remove</a>().
<p>Reimplemented from <a href="qcollection.html#10eb2d">QCollection.</a>
<h3 class="fn">uint<a name="5436fb"></a>QQueue::count()const <code>[virtual]</code></h3>
<p>Returns the number of items in the queue.
<p>See also <a href="#6f4506">isEmpty</a>().
<p>Reimplemented from <a href="qcollection.html#649c42">QCollection.</a>
<h3 class="fn">type*<a name="ad2472"></a>QQueue::current()const</h3>
<p>Returns a reference to the front item in the queue. The queue is
not changed.
<h3 class="fn">type*<a name="b8b005"></a>QQueue::dequeue()</h3>
<p>Takes the front item from the queue. First in, first out.
<h3 class="fn">void<a name="67b0b6"></a>QQueue::enqueue(consttype*d)</h3>
<p>Adds an item to the back of the queue. First in, first out.
<h3 class="fn">type*<a name="bcccec"></a>QQueue::head()const</h3>
<p>Returns a reference to the front item in the queue. The queue is
not changed.
<h3 class="fn">bool<a name="6f4506"></a>QQueue::isEmpty()const</h3>
<p>Returns TRUE if there are no items to be <a href="#b8b005">dequeued</a>
<h3 class="fn">QQueue<type>&<a name="2d5bc8"></a>QQueue::operator=(constQQueue<type>&queue)</h3>
<p>Assigns <em>queue</em> to this queue and returns a reference to this queue.
<p>This queue is first cleared, then each item in <em>queue</em> is
enqueued to this queue. Only the pointers are copied (shallow copy).
<h3 class="fn">bool<a name="876afe"></a>QQueue::remove()</h3>
<p>Removes the front item from the queue. First in, first out.
The item is deleted if <a href="#1e17ee">autoDelete</a>() is TRUE.
Returns TRUE if there was an item to remove.
<h3 class="fn">void<a name="342a2b"></a>QQueue::setAutoDelete(boolenable)</h3>
<p>The same as <a href="qcollection.html#a3fc3c">QCollection::setAutoDelete</a>().
<p>See also <a href="#1e17ee">autoDelete</a>().
<hr><p>
Search the documentation, FAQ, qt-interest archive and more (uses
<a href="http://www.trolltech.com">www.trolltech.com</a>):<br>
<form method=post action="http://www.trolltech.com/search.cgi">
<input type=hidden name="version" value="2.3.1"><nobr>
<input size="50" name="search"><input type=submit value="Search">
</nobr></form><hr><p>
This file is part of the <a href="index.html">Qt toolkit</a>,
copyright © 1995-2000
<a href="http://www.trolltech.com">Trolltech</a>, all rights reserved.<p><address><hr><div align="center">
<table width="100%" cellspacing="0" border="0"><tr>
<td>Copyright 2000 Trolltech<td><a href="http://www.trolltech.com/trademarks.html">Trademarks</a>
<td align="right"><div align="right">Qt version 2.3.1</div>
</table></div></address></body></html>
|