Imported Upstream version 1.8.2
[platform/upstream/doxygen.git] / qtools / qstack.doc
1 /****************************************************************************
2 ** 
3 **
4 ** QStack class documentation
5 **
6 ** Copyright (C) 1992-2000 Trolltech AS.  All rights reserved.
7 **
8 ** This file is part of the Qt GUI Toolkit.
9 **
10 ** This file may be distributed under the terms of the Q Public License
11 ** as defined by Trolltech AS of Norway and appearing in the file
12 ** LICENSE.QPL included in the packaging of this file.
13 **
14 ** This file may be distributed and/or modified under the terms of the
15 ** GNU General Public License version 2 as published by the Free Software
16 ** Foundation and appearing in the file LICENSE.GPL included in the
17 ** packaging of this file.
18 **
19 ** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
20 ** licenses may use this file in accordance with the Qt Commercial License
21 ** Agreement provided with the Software.
22 **
23 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
24 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
25 **
26 ** See http://www.trolltech.com/pricing.html or email sales@trolltech.com for
27 **   information about Qt Commercial License Agreements.
28 ** See http://www.trolltech.com/qpl/ for QPL licensing information.
29 ** See http://www.trolltech.com/gpl/ for GPL licensing information.
30 **
31 ** Contact info@trolltech.com if any conditions of this licensing are
32 ** not clear to you.
33 **
34 **********************************************************************/
35
36
37 /*****************************************************************************
38   QStack documentation
39  *****************************************************************************/
40
41 /*!
42   \class QStack qstack.h
43   \brief The QStack class is a template class that provides a stack.
44
45   \ingroup collection
46   \ingroup tools
47
48   QStack is implemented as a template class. Define a template
49   instance QStack\<X\> to create a stack that operates on pointers to
50   X, or X*.
51
52   A stack is a Last In, First Out (LIFO) structure. Items are added to
53   the top of the stack with push() and retrieved from the top
54   with pop().
55
56   \sa \link collection.html Collection Classes\endlink
57 */
58
59 /*! \fn QStack::QStack () 
60   Creates and empty stack.
61 */
62
63 /*! \fn QStack::QStack (const QStack<type>& s) 
64   Creates a stack by making a shallow copy of another stack.
65 */
66
67 /*! \fn QStack::~QStack () 
68   Destroys the stack.  All items will be deleted if autoDelete() is TRUE.
69 */
70
71 /*! \fn QStack<type>& QStack::operator= (const QStack<type>& s) 
72   Sets the contents of this stack by making a shallow copy of another stack.
73   Elements currently in this stack will be deleted if autoDelete() is TRUE.
74 */
75
76 /*! \fn bool QStack::isEmpty () const 
77   Returns TRUE is the stack contains no elements to be \link pop() popped\endlink.
78 */
79
80 /*! \fn void QStack::push (const type* d) 
81   Adds an element to the top of the stack.  Last in, first out.
82 */
83
84 /*! \fn type* QStack::pop () 
85   Removes the top item from the stack and returns it.
86 */
87
88 /*! \fn bool QStack::remove () 
89   Removes the top item from the stack and deletes it if
90   autoDelete() is TRUE.  Returns TRUE if there was an item to pop.
91
92   \sa clear()
93 */
94
95 /*! \fn void QStack::clear()
96   Removes all items from the stack, deleting them if
97   autoDelete() is TRUE.
98
99   \sa remove()
100 */
101
102 /*! \fn uint QStack::count() const
103   Returns the number of items in the stack.
104
105   \sa isEmpty()
106 */
107
108 /*! \fn type* QStack::top () const 
109   Returns a reference to the top item on the stack (most recently pushed).
110   The stack is not changed.
111 */
112
113 /*! \fn QStack::operator type* ()const 
114   Returns a reference to the top item on the stack (most recently pushed).
115   The stack is not changed.
116 */
117
118 /*! \fn type* QStack::current () const 
119   Returns a reference to the top item on the stack (most recently pushed).
120   The stack is not changed.
121 */
122
123 /*! \fn bool QStack::autoDelete() const
124
125   The same as QCollection::autoDelete().
126
127   \sa setAutoDelete()
128 */
129
130 /*! \fn void QStack::setAutoDelete( bool enable ) 
131
132   The same as QCollection::setAutoDelete().
133  
134   \sa autoDelete()
135 */