The parameterized class Stack<E> implements list-based stacks. More...
#include <ogdf/basic/Stack.h>
Inheritance diagram for ogdf::Stack< E >:Public Types | |
| using | size_type = size_t |
| The number of elements in the list. More... | |
Public Member Functions | |
| Stack () | |
| Constructs an empty stack. More... | |
| Stack (std::initializer_list< E > initList) | |
Constructs a stack and pushes the elements in initList on it (last element will be on top). More... | |
| Stack (const Stack< E > &S) | |
Constructs a stack that is a copy of S. More... | |
| Stack (Stack< E > &&S) | |
Constructs a stack containing the elements of S (move semantics). More... | |
| ~Stack () | |
| Destruction. More... | |
| void | clear () |
| Makes the stack empty. More... | |
| template<class ... Args> | |
| void | emplace (Args &&... args) |
| Adds a new element at as top-most element to the stack. More... | |
| bool | empty () const |
| Returns true iff the stack is empty. More... | |
| Stack< E > & | operator= (const Stack< E > &S) |
| Assignment operator. More... | |
| Stack< E > & | operator= (Stack< E > &&S) |
| Assignment operator (move semantics). More... | |
| E | pop () |
| Removes the top-most element from the stack and returns it. More... | |
| void | print (ostream &os, char delim=' ') const |
| void | push (const E &x) |
Adds element x as top-most element to the stack. More... | |
| size_t | size () const |
| Returns the number of elements contained in the stack. More... | |
| const E & | top () const |
| Returns a reference to the top element. More... | |
| E & | top () |
| Returns a reference to the top element. More... | |
Private Attributes | |
| size_t | m_count |
Additional Inherited Members | |
Private Member Functions inherited from ogdf::StackPure< E > | |
| StackPure () | |
| Constructs an empty stack. More... | |
| StackPure (std::initializer_list< E > initList) | |
Constructs a stack and pushes the elements in initList on it (last element will be on top). More... | |
| StackPure (const StackPure< E > &S) | |
Constructs a stack that is a copy of S. More... | |
| StackPure (StackPure< E > &&S) | |
Constructs a stack containing the elements of S (move semantics). More... | |
| ~StackPure () | |
| Destruction. More... | |
| void | clear () |
| Makes the stack empty. More... | |
| template<class ... Args> | |
| void | emplace (Args &&... args) |
| Adds a new element at as top-most element to the stack. More... | |
| bool | empty () const |
| Returns true iff the stack is empty. More... | |
| StackPure< E > & | operator= (const StackPure< E > &S) |
| Assignment operator. More... | |
| StackPure< E > & | operator= (StackPure< E > &&S) |
| Assignment operator (move semantics). More... | |
| E | pop () |
| Removes the top-most element from the stack and returns it. More... | |
| void | print (ostream &os, char delim=' ') const |
| void | push (const E &x) |
Adds element x as top-most element to the stack. More... | |
| const E & | top () const |
| Returns a reference to the top element. More... | |
| E & | top () |
| Returns a reference to the top element. More... | |
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. |
| using ogdf::Stack< E >::size_type = size_t |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
private |