The parameterized class Stack<E> implements list-based stacks. More...
#include <ogdf/basic/Stack.h>
Inheritance diagram for ogdf::Stack< E >:Public Member Functions | |
| Stack () | |
| The number of elements in the list. | |
| Stack (const Stack< E > &S) | |
| Constructs a stack that is a copy of S. | |
| ~Stack () | |
| void | clear () |
| Makes the stack empty. | |
| bool | empty () const |
| Returns true iff the stack is empty. | |
| Stack< E > & | operator= (const Stack< E > &S) |
| Assignment operator. | |
| E | pop () |
| Removes the top-most element from the stack and returns it. | |
| void | print (ostream &os, char delim= ' ') const |
| void | push (const E &x) |
| Adds element x as top-most element to the stack. | |
| int | size () const |
| Returns the number of elements contained in the stack. | |
| const E & | top () const |
| Returns a reference to the top element. | |
| E & | top () |
| Returns a reference to the top element. | |
Private Attributes | |
| int | m_count |
Additional Inherited Members | |
Private Member Functions inherited from ogdf::StackPure< E > | |
| StackPure () | |
| Constructs an empty stack. | |
| StackPure (const StackPure< E > &S) | |
| Constructs a stack that is a copy of S. | |
| ~StackPure () | |
| StackPure< E > & | operator= (const StackPure< E > &S) |
| Assignment operator. | |
The parameterized class Stack<E> implements list-based stacks.
In contrast to StackPure<E>, instances of Stack<E> store the number of elements contained in the stack.
| E | is the element type. |
|
inline |
|
inline |
|
inline |
|
inline |
Makes the stack empty.
Reimplemented from ogdf::StackPure< E >.
|
inline |
Returns true iff the stack is empty.
Reimplemented from ogdf::StackPure< E >.
|
inline |
|
inline |
Removes the top-most element from the stack and returns it.
Reimplemented from ogdf::StackPure< E >.
|
inline |
Reimplemented from ogdf::StackPure< E >.
|
inline |
Adds element x as top-most element to the stack.
Reimplemented from ogdf::StackPure< E >.
|
inline |
|
inline |
Returns a reference to the top element.
Reimplemented from ogdf::StackPure< E >.
|
inline |
Returns a reference to the top element.
Reimplemented from ogdf::StackPure< E >.
|
private |