~oif-team/ubuntu/natty/qt4-x11/xi2.1

« back to all changes in this revision

Viewing changes to doc/html/q3ptrstack.html

  • Committer: Bazaar Package Importer
  • Author(s): Adam Conrad
  • Date: 2005-08-24 04:09:09 UTC
  • Revision ID: james.westby@ubuntu.com-20050824040909-xmxe9jfr4a0w5671
Tags: upstream-4.0.0
ImportĀ upstreamĀ versionĀ 4.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
<?xml version="1.0" encoding="iso-8859-1"?>
 
2
<!DOCTYPE html
 
3
    PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
 
4
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
 
5
<!-- /tmp/qt-4.0.0-espenr-1119621036935/qt-x11-opensource-desktop-4.0.0/doc/src/q3ptrstack.qdoc -->
 
6
<head>
 
7
    <title>Qt 4.0: Q3PtrStack Class Reference</title>
 
8
    <style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm; }
 
9
a:link { color: #004faf; text-decoration: none }
 
10
a:visited { color: #672967; text-decoration: none }
 
11
td.postheader { font-family: sans-serif }
 
12
tr.address { font-family: sans-serif }
 
13
body { background: #ffffff; color: black; }</style>
 
14
</head>
 
15
<body>
 
16
<table border="0" cellpadding="0" cellspacing="0" width="100%">
 
17
<tr>
 
18
<td align="left" valign="top" width="32"><img src="images/qt-logo.png" align="left" width="32" height="32" border="0" /></td>
 
19
<td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">All&nbsp;Classes</font></a>&nbsp;&middot; <a href="mainclasses.html"><font color="#004faf">Main&nbsp;Classes</font></a>&nbsp;&middot; <a href="annotated.html"><font color="#004faf">Annotated</font></a>&nbsp;&middot; <a href="groups.html"><font color="#004faf">Grouped&nbsp;Classes</font></a>&nbsp;&middot; <a href="functions.html"><font color="#004faf">Functions</font></a></td>
 
20
<td align="right" valign="top" width="230"><img src="images/trolltech-logo.png" align="right" width="203" height="32" border="0" /></td></tr></table><h1 align="center">Q3PtrStack Class Reference</h1>
 
21
<p>The Q3PtrStack class is a template class that provides a stack. <a href="#details">More...</a></p>
 
22
<pre>#include &lt;Q3PtrStack&gt;</pre><p><b>This class is part of the Qt 3 support library.</b> It is provided to keep old source code working. We strongly advise against using it in new code. See the <a href="porting4.html">Porting Guide</a> for more information.</p>
 
23
<p>Part of the <a href="qt3support.html">Qt3Support</a> module.</p>
 
24
<p>Inherits <a href="q3ptrcollection.html">Q3PtrCollection</a>.</p>
 
25
<ul>
 
26
<li><a href="q3ptrstack-members.html">List of all members, including inherited members</a></li>
 
27
</ul>
 
28
<a name="public-functions"></a>
 
29
<h3>Public Functions</h3>
 
30
<ul>
 
31
<li><div class="fn"/><b><a href="q3ptrstack.html#Q3PtrStack">Q3PtrStack</a></b> ()</li>
 
32
<li><div class="fn"/><b><a href="q3ptrstack.html#Q3PtrStack-2">Q3PtrStack</a></b> ( const Q3PtrStack&lt;type&gt; &amp; <i>s</i> )</li>
 
33
<li><div class="fn"/><b><a href="q3ptrstack.html#dtor.Q3PtrStack">~Q3PtrStack</a></b> ()</li>
 
34
<li><div class="fn"/>bool <b><a href="q3ptrstack.html#autoDelete">autoDelete</a></b> () const</li>
 
35
<li><div class="fn"/>virtual void <b><a href="q3ptrstack.html#clear">clear</a></b> ()</li>
 
36
<li><div class="fn"/>virtual uint <b><a href="q3ptrstack.html#count">count</a></b> () const</li>
 
37
<li><div class="fn"/>type * <b><a href="q3ptrstack.html#current">current</a></b> () const</li>
 
38
<li><div class="fn"/>bool <b><a href="q3ptrstack.html#isEmpty">isEmpty</a></b> () const</li>
 
39
<li><div class="fn"/>type * <b><a href="q3ptrstack.html#pop">pop</a></b> ()</li>
 
40
<li><div class="fn"/>void <b><a href="q3ptrstack.html#push">push</a></b> ( const type * <i>d</i> )</li>
 
41
<li><div class="fn"/>bool <b><a href="q3ptrstack.html#remove">remove</a></b> ()</li>
 
42
<li><div class="fn"/>void <b><a href="q3ptrstack.html#setAutoDelete">setAutoDelete</a></b> ( bool <i>enable</i> )</li>
 
43
<li><div class="fn"/>type * <b><a href="q3ptrstack.html#top">top</a></b> () const</li>
 
44
<li><div class="fn"/><b><a href="q3ptrstack.html#operator-type--2a">operator type *</a></b> () const</li>
 
45
<li><div class="fn"/>Q3PtrStack&lt;type&gt; &amp; <b><a href="q3ptrstack.html#operator-eq">operator=</a></b> ( const Q3PtrStack&lt;type&gt; &amp; <i>s</i> )</li>
 
46
</ul>
 
47
<ul>
 
48
<li><div class="fn"/>4 public functions inherited from <a href="q3ptrcollection.html#public-functions">Q3PtrCollection</a></li>
 
49
</ul>
 
50
<a name="protected-functions"></a>
 
51
<h3>Protected Functions</h3>
 
52
<ul>
 
53
<li><div class="fn"/>virtual QDataStream &amp; <b><a href="q3ptrstack.html#read">read</a></b> ( QDataStream &amp; <i>s</i>, Q3PtrCollection::Item &amp; <i>item</i> )</li>
 
54
<li><div class="fn"/>virtual QDataStream &amp; <b><a href="q3ptrstack.html#write">write</a></b> ( QDataStream &amp; <i>s</i>, Q3PtrCollection::Item <i>item</i> ) const</li>
 
55
</ul>
 
56
<ul>
 
57
<li><div class="fn"/>2 protected functions inherited from <a href="q3ptrcollection.html#protected-functions">Q3PtrCollection</a></li>
 
58
</ul>
 
59
<a name="details"></a>
 
60
<hr />
 
61
<h2>Detailed Description</h2>
 
62
<p>The Q3PtrStack class is a template class that provides a stack.</p>
 
63
<p><a href="q3valuestack.html">Q3ValueStack</a> is an STL-compatible alternative to this class.</p>
 
64
<p>Define a template instance Q3PtrStack&lt;X&gt; to create a stack that operates on pointers to X, (X*).</p>
 
65
<p>A stack is a last in, first out (LIFO) structure. Items are added to the top of the stack with <a href="q3ptrstack.html#push">push</a>() and retrieved from the top with <a href="q3ptrstack.html#pop">pop</a>(). Use <a href="q3ptrstack.html#top">top</a>() to get a reference to the top element without changing the stack.</p>
 
66
<p>You can control the stack's deletion policy with <a href="q3ptrstack.html#setAutoDelete">setAutoDelete</a>().</p>
 
67
<p>For compatibility with the <a href="q3ptrcollection.html">Q3PtrCollection</a> classes <a href="q3ptrstack.html#current">current</a>() and <a href="q3ptrstack.html#remove">remove</a>() are provided; they both operate on the <a href="q3ptrstack.html#top">top</a>().</p>
 
68
<p>See also <a href="q3ptrlist.html">Q3PtrList</a> and <a href="q3ptrqueue.html">Q3PtrQueue</a>.</p>
 
69
<hr />
 
70
<h2>Member Function Documentation</h2>
 
71
<h3 class="fn"><a name="Q3PtrStack"></a>Q3PtrStack::Q3PtrStack ()</h3>
 
72
<p>Creates an empty stack.</p>
 
73
<h3 class="fn"><a name="Q3PtrStack-2"></a>Q3PtrStack::Q3PtrStack ( const Q3PtrStack&lt;type&gt; &amp; <i>s</i> )</h3>
 
74
<p>Creates a stack by making a shallow copy of another stack <i>s</i>.</p>
 
75
<h3 class="fn"><a name="dtor.Q3PtrStack"></a>Q3PtrStack::~Q3PtrStack ()</h3>
 
76
<p>Destroys the stack. All items will be deleted if <a href="q3ptrstack.html#autoDelete">autoDelete</a>() is TRUE.</p>
 
77
<h3 class="fn"><a name="autoDelete"></a>bool Q3PtrStack::autoDelete () const</h3>
 
78
<p>The same as <a href="q3ptrcollection.html#autoDelete">Q3PtrCollection::autoDelete</a>().</p>
 
79
<p>See also <a href="q3ptrstack.html#setAutoDelete">setAutoDelete</a>().</p>
 
80
<h3 class="fn"><a name="clear"></a>void Q3PtrStack::clear ()&nbsp;&nbsp;<tt> [virtual]</tt></h3>
 
81
<p>Removes all items from the stack, deleting them if <a href="q3ptrstack.html#autoDelete">autoDelete</a>() is TRUE.</p>
 
82
<p>Reimplemented from <a href="q3ptrcollection.html#clear">Q3PtrCollection</a>.</p>
 
83
<p>See also <a href="q3ptrstack.html#remove">remove</a>().</p>
 
84
<h3 class="fn"><a name="count"></a><a href="qtglobal.html#uint-typedef">uint</a> Q3PtrStack::count () const&nbsp;&nbsp;<tt> [virtual]</tt></h3>
 
85
<p>Returns the number of items in the stack.</p>
 
86
<p>Reimplemented from <a href="q3ptrcollection.html#count">Q3PtrCollection</a>.</p>
 
87
<p>See also <a href="q3ptrstack.html#isEmpty">isEmpty</a>().</p>
 
88
<h3 class="fn"><a name="current"></a>type * Q3PtrStack::current () const</h3>
 
89
<p>Returns a pointer to the top item on the stack (most recently pushed). The stack is not changed. Returns 0 if the stack is empty.</p>
 
90
<h3 class="fn"><a name="isEmpty"></a>bool Q3PtrStack::isEmpty () const</h3>
 
91
<p>Returns TRUE if the stack contains no elements; otherwise returns FALSE.</p>
 
92
<h3 class="fn"><a name="pop"></a>type * Q3PtrStack::pop ()</h3>
 
93
<p>Removes the top item from the stack and returns it. The stack must not be empty.</p>
 
94
<h3 class="fn"><a name="push"></a>void Q3PtrStack::push ( const type * <i>d</i> )</h3>
 
95
<p>Adds an element <i>d</i> to the top of the stack. Last in, first out.</p>
 
96
<h3 class="fn"><a name="read"></a><a href="qdatastream.html">QDataStream</a> &amp; Q3PtrStack::read ( <a href="qdatastream.html">QDataStream</a> &amp; <i>s</i>, <a href="q3ptrcollection.html#Item-typedef">Q3PtrCollection::Item</a> &amp; <i>item</i> )&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
 
97
<p>Reads a stack item, <i>item</i>, from the stream <i>s</i> and returns a reference to the stream.</p>
 
98
<p>The default implementation sets <i>item</i> to 0.</p>
 
99
<p>Reimplemented from <a href="q3glist.html#read-2">Q3GList</a>.</p>
 
100
<p>See also <a href="q3ptrstack.html#write">write</a>().</p>
 
101
<h3 class="fn"><a name="remove"></a>bool Q3PtrStack::remove ()</h3>
 
102
<p>Removes the top item from the stack and deletes it if <a href="q3ptrstack.html#autoDelete">autoDelete</a>() is TRUE. Returns TRUE if there was an item to pop; otherwise returns FALSE.</p>
 
103
<p>See also <a href="q3ptrstack.html#clear">clear</a>().</p>
 
104
<h3 class="fn"><a name="setAutoDelete"></a>void Q3PtrStack::setAutoDelete ( bool <i>enable</i> )</h3>
 
105
<p>Defines whether this stack auto-deletes its contents. The same as <a href="q3ptrcollection.html#setAutoDelete">Q3PtrCollection::setAutoDelete</a>().</p>
 
106
<p>If <i>enable</i> is TRUE the stack auto-deletes its contents; if <i>enable</i> is FALSE the stack does not delete its contents.</p>
 
107
<p>See also <a href="q3ptrstack.html#autoDelete">autoDelete</a>().</p>
 
108
<h3 class="fn"><a name="top"></a>type * Q3PtrStack::top () const</h3>
 
109
<p>Returns a pointer to the top item on the stack (most recently pushed). The stack is not changed. Returns 0 if the stack is empty.</p>
 
110
<h3 class="fn"><a name="write"></a><a href="qdatastream.html">QDataStream</a> &amp; Q3PtrStack::write ( <a href="qdatastream.html">QDataStream</a> &amp; <i>s</i>, <a href="q3ptrcollection.html#Item-typedef">Q3PtrCollection::Item</a> <i>item</i> ) const&nbsp;&nbsp;<tt> [virtual protected]</tt></h3>
 
111
<p>Writes a stack item, <i>item</i>, to the stream <i>s</i> and returns a reference to the stream.</p>
 
112
<p>The default implementation does nothing.</p>
 
113
<p>Reimplemented from <a href="q3glist.html#write-2">Q3GList</a>.</p>
 
114
<p>See also <a href="q3ptrstack.html#read">read</a>().</p>
 
115
<h3 class="fn"><a name="operator-type--2a"></a>Q3PtrStack::operator type * () const</h3>
 
116
<p>Returns a pointer to the top item on the stack (most recently pushed). The stack is not changed. Returns 0 if the stack is empty.</p>
 
117
<h3 class="fn"><a name="operator-eq"></a>Q3PtrStack&lt;type&gt; &amp; Q3PtrStack::operator= ( const Q3PtrStack&lt;type&gt; &amp; <i>s</i> )</h3>
 
118
<p>Sets the contents of this stack by making a shallow copy of another stack <i>s</i>. Elements currently in this stack will be deleted if <a href="q3ptrstack.html#autoDelete">autoDelete</a>() is TRUE.</p>
 
119
<p /><address><hr /><div align="center">
 
120
<table width="100%" cellspacing="0" border="0"><tr class="address">
 
121
<td width="30%">Copyright &copy; 2005 <a href="trolltech.html">Trolltech</a></td>
 
122
<td width="40%" align="center"><a href="trademarks.html">Trademarks</a></td>
 
123
<td width="30%" align="right"><div align="right">Qt 4.0.0</div></td>
 
124
</tr></table></div></address></body>
 
125
</html>