A stack whose storage capacity is variable at run-time. Similar to std::vector. More...
#include <stack.h>
Public Types | |
typedef const_pointer | const_iterator |
Public Member Functions | |
Stack () | |
Stack (const Type &value) | |
Stack (const Stack &other) | |
~Stack () | |
const_iterator | begin () const |
const_iterator | end () const |
bool | empty () const |
void | clear () |
std::size_t | size () const |
Type | operator[] (const std::size_t i) const |
void | push (const Type &value) |
Pushes value onto the stack at the top element. If reserved storage is insufficient for the new element, this will invalidate all iterators. | |
void | pop () |
Removes the top element of the stack. | |
Type & | top () |
Returns the top element of the mutable stack. | |
const Type & | top () const |
Returns the top element of the non-mutable stack. | |
Type & | parent () |
Returns the element below the top element of the mutable stack. | |
const Type & | parent () const |
Returns the element below the top element of the non-mutable stack. | |
void | swap (Stack &other) |
Swaps the values of this stack and other . | |
Stack & | operator= (const Stack &other) |
Private Types | |
enum | { DEFAULT_CAPACITY = 4 } |
typedef DefaultAllocator< Type > | Allocator |
typedef Type * | pointer |
typedef const Type * | const_pointer |
Private Member Functions | |
void | insert (const Type &value) |
void | insert_overflow (const Type &value) |
void | destroy () |
void | construct (const Stack &other) |
Private Attributes | |
pointer | m_data |
pointer | m_end |
std::size_t | m_capacity |
A stack whose storage capacity is variable at run-time. Similar to std::vector.
Type,: | The type to be stored in the stack. Must provide a copy-constructor. |
Definition at line 37 of file stack.h.
typedef DefaultAllocator<Type> Stack< Type >::Allocator [private] |
typedef const_pointer Stack< Type >::const_iterator |
typedef const Type* Stack< Type >::const_pointer [private] |
anonymous enum [private] |
const_iterator Stack< Type >::begin | ( | ) | const [inline] |
Definition at line 114 of file stack.h.
Referenced by Stack< NodeReference >::construct(), Stack< NodeReference >::empty(), Brush::instanceAttach(), MapRoot::instanceAttach(), MapRoot::instanceDetach(), and operator<().
void Stack< Type >::clear | ( | ) | [inline] |
void Stack< Type >::construct | ( | const Stack< Type > & | other | ) | [inline, private] |
Definition at line 81 of file stack.h.
Referenced by Stack< NodeReference >::construct(), Stack< NodeReference >::insert(), and Stack< NodeReference >::Stack().
void Stack< Type >::destroy | ( | ) | [inline, private] |
Definition at line 75 of file stack.h.
Referenced by Stack< NodeReference >::clear(), Stack< NodeReference >::destroy(), Stack< NodeReference >::insert_overflow(), Stack< NodeReference >::pop(), and Stack< NodeReference >::~Stack().
bool Stack< Type >::empty | ( | ) | const [inline] |
const_iterator Stack< Type >::end | ( | ) | const [inline] |
Definition at line 118 of file stack.h.
Referenced by Stack< NodeReference >::construct(), Stack< NodeReference >::empty(), Brush::instanceAttach(), MapRoot::instanceAttach(), MapRoot::instanceDetach(), and operator<().
void Stack< Type >::insert | ( | const Type & | value | ) | [inline, private] |
Definition at line 57 of file stack.h.
Referenced by Stack< NodeReference >::insert_overflow(), and Stack< NodeReference >::push().
void Stack< Type >::insert_overflow | ( | const Type & | value | ) | [inline, private] |
Definition at line 61 of file stack.h.
Referenced by Stack< NodeReference >::push().
Type Stack< Type >::operator[] | ( | const std::size_t | i | ) | const [inline] |
const Type& Stack< Type >::parent | ( | ) | const [inline] |
Type& Stack< Type >::parent | ( | ) | [inline] |
void Stack< Type >::pop | ( | ) | [inline] |
Removes the top element of the stack.
Definition at line 151 of file stack.h.
Referenced by UninstanceSubgraphWalker::post(), and InstanceSubgraphWalker::post().
void Stack< Type >::push | ( | const Type & | value | ) | [inline] |
Pushes value
onto the stack at the top element. If reserved storage is insufficient for the new element, this will invalidate all iterators.
Definition at line 142 of file stack.h.
Referenced by UninstanceSubgraphWalker::pre(), InstanceSubgraphWalker::pre(), and Stack< NodeReference >::Stack().
std::size_t Stack< Type >::size | ( | ) | const [inline] |
Definition at line 133 of file stack.h.
Referenced by Stack< NodeReference >::push(), and Stack< NodeReference >::Stack().
Swaps the values of this stack and other
.
Definition at line 176 of file stack.h.
Referenced by Stack< NodeReference >::operator=(), and Stack< NodeReference >::swap().
const Type& Stack< Type >::top | ( | ) | const [inline] |
Type& Stack< Type >::top | ( | ) | [inline] |
Returns the top element of the mutable stack.
Definition at line 156 of file stack.h.
Referenced by BrushVisibleWalker< Functor >::pre(), and InstanceSubgraphWalker::pre().
std::size_t Stack< Type >::m_capacity [private] |
Definition at line 55 of file stack.h.
Referenced by Stack< NodeReference >::insert_overflow(), Stack< NodeReference >::push(), Stack< NodeReference >::Stack(), Stack< NodeReference >::swap(), and Stack< NodeReference >::~Stack().
Definition at line 53 of file stack.h.
Referenced by Stack< NodeReference >::begin(), Stack< NodeReference >::clear(), Stack< NodeReference >::construct(), Stack< NodeReference >::destroy(), Stack< NodeReference >::insert_overflow(), Stack< NodeReference >::operator[](), Stack< NodeReference >::size(), Stack< NodeReference >::Stack(), Stack< NodeReference >::swap(), and Stack< NodeReference >::~Stack().
Definition at line 54 of file stack.h.
Referenced by Stack< NodeReference >::clear(), Stack< NodeReference >::destroy(), Stack< NodeReference >::end(), Stack< NodeReference >::insert(), Stack< NodeReference >::insert_overflow(), Stack< NodeReference >::parent(), Stack< NodeReference >::pop(), Stack< NodeReference >::size(), Stack< NodeReference >::Stack(), Stack< NodeReference >::swap(), and Stack< NodeReference >::top().