1 | /****************************************************************************
|
---|
2 | **
|
---|
3 | ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
|
---|
4 | ** All rights reserved.
|
---|
5 | ** Contact: Nokia Corporation ([email protected])
|
---|
6 | **
|
---|
7 | ** This file is part of the documentation of the Qt Toolkit.
|
---|
8 | **
|
---|
9 | ** $QT_BEGIN_LICENSE:FDL$
|
---|
10 | ** Commercial Usage
|
---|
11 | ** Licensees holding valid Qt Commercial licenses may use this file in
|
---|
12 | ** accordance with the Qt Commercial License Agreement provided with the
|
---|
13 | ** Software or, alternatively, in accordance with the terms contained in a
|
---|
14 | ** written agreement between you and Nokia.
|
---|
15 | **
|
---|
16 | ** GNU Free Documentation License
|
---|
17 | ** Alternatively, this file may be used under the terms of the GNU Free
|
---|
18 | ** Documentation License version 1.3 as published by the Free Software
|
---|
19 | ** Foundation and appearing in the file included in the packaging of this
|
---|
20 | ** file.
|
---|
21 | **
|
---|
22 | ** If you have questions regarding the use of this file, please contact
|
---|
23 | ** Nokia at [email protected].
|
---|
24 | ** $QT_END_LICENSE$
|
---|
25 | **
|
---|
26 | ****************************************************************************/
|
---|
27 |
|
---|
28 | /*!
|
---|
29 | \class Q3PtrStack
|
---|
30 | \brief The Q3PtrStack class is a template class that provides a stack.
|
---|
31 | \compat
|
---|
32 |
|
---|
33 | Q3ValueStack is an STL-compatible alternative to this class.
|
---|
34 |
|
---|
35 | Define a template instance Q3PtrStack\<X\> to create a stack that
|
---|
36 | operates on pointers to X, (X*).
|
---|
37 |
|
---|
38 | A stack is a last in, first out (LIFO) structure. Items are added
|
---|
39 | to the top of the stack with push() and retrieved from the top
|
---|
40 | with pop(). Use top() to get a reference to the top element
|
---|
41 | without changing the stack.
|
---|
42 |
|
---|
43 | You can control the stack's deletion policy with setAutoDelete().
|
---|
44 |
|
---|
45 | For compatibility with the Q3PtrCollection classes current() and
|
---|
46 | remove() are provided; they both operate on the top().
|
---|
47 |
|
---|
48 | \sa Q3PtrList Q3PtrQueue
|
---|
49 | */
|
---|
50 |
|
---|
51 | /*!
|
---|
52 | \fn Q3PtrStack::Q3PtrStack ()
|
---|
53 |
|
---|
54 | Creates an empty stack.
|
---|
55 | */
|
---|
56 |
|
---|
57 | /*!
|
---|
58 | \fn Q3PtrStack::Q3PtrStack (const Q3PtrStack<type>& s)
|
---|
59 |
|
---|
60 | Creates a stack by making a shallow copy of another stack \a s.
|
---|
61 | */
|
---|
62 |
|
---|
63 | /*!
|
---|
64 | \fn Q3PtrStack::~Q3PtrStack ()
|
---|
65 |
|
---|
66 | Destroys the stack. All items will be deleted if autoDelete() is
|
---|
67 | true.
|
---|
68 | */
|
---|
69 |
|
---|
70 | /*!
|
---|
71 | \fn Q3PtrStack<type>& Q3PtrStack::operator= (const Q3PtrStack<type>& s)
|
---|
72 |
|
---|
73 | Sets the contents of this stack by making a shallow copy of
|
---|
74 | another stack \a s. Elements currently in this stack will be
|
---|
75 | deleted if autoDelete() is true.
|
---|
76 | */
|
---|
77 |
|
---|
78 | /*!
|
---|
79 | \fn bool Q3PtrStack::isEmpty () const
|
---|
80 |
|
---|
81 | Returns true if the stack contains no elements; otherwise returns
|
---|
82 | false.
|
---|
83 | */
|
---|
84 |
|
---|
|
---|