The parameterized class Stack<E> implements list-based stacks. More...
#include <ogdf/basic/Stack.h>
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 () | |
| bool | empty () const |
| Returns true iff the stack is empty. | |
| 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. | |
| Stack< E > & | operator= (const Stack< E > &S) |
| Assignment operator. | |
| void | push (const E &x) |
| Adds element x as top-most element to the stack. | |
| E | pop () |
| Removes the top-most element from the stack and returns it. | |
| void | clear () |
| Makes the stack empty. | |
| void | print (ostream &os, char delim= ' ') const |
| void * | operator new (size_t nBytes) |
| void * | operator new (size_t, void *p) |
| void | operator delete (void *p, size_t nBytes) |
Private Attributes | |
| int | m_count |
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.
Definition at line 312 of file Stack.h.
| ogdf::Stack< E >::Stack | ( | ) | [inline] |
| ogdf::Stack< E >::Stack | ( | const Stack< E > & | S | ) | [inline] |
| ogdf::Stack< E >::~Stack | ( | ) | [inline] |
| void ogdf::Stack< E >::clear | ( | ) | [inline] |
Makes the stack empty.
Reimplemented from ogdf::StackPure< E >.
| bool ogdf::Stack< E >::empty | ( | ) | const [inline] |
Returns true iff the stack is empty.
Reimplemented from ogdf::StackPure< E >.
| void ogdf::Stack< E >::operator delete | ( | void * | p, | |
| size_t | nBytes | |||
| ) | [inline] |
Reimplemented from ogdf::StackPure< E >.
| void* ogdf::Stack< E >::operator new | ( | size_t | nBytes | ) | [inline] |
Reimplemented from ogdf::StackPure< E >.
| void* ogdf::Stack< E >::operator new | ( | size_t | , | |
| void * | p | |||
| ) | [inline] |
Reimplemented from ogdf::StackPure< E >.
| Stack<E>& ogdf::Stack< E >::operator= | ( | const Stack< E > & | S | ) | [inline] |
| E ogdf::Stack< E >::pop | ( | ) | [inline] |
Removes the top-most element from the stack and returns it.
Reimplemented from ogdf::StackPure< E >.
| void ogdf::Stack< E >::print | ( | ostream & | os, | |
| char | delim = ' ' | |||
| ) | const [inline] |
Reimplemented from ogdf::StackPure< E >.
| void ogdf::Stack< E >::push | ( | const E & | x | ) | [inline] |
Adds element x as top-most element to the stack.
Reimplemented from ogdf::StackPure< E >.
| int ogdf::Stack< E >::size | ( | ) | const [inline] |
| const E& ogdf::Stack< E >::top | ( | ) | const [inline] |
Returns a reference to the top element.
Reimplemented from ogdf::StackPure< E >.
| E& ogdf::Stack< E >::top | ( | ) | [inline] |
Returns a reference to the top element.
Reimplemented from ogdf::StackPure< E >.
int ogdf::Stack< E >::m_count [private] |