bWidgets
Core widget toolkit designed for Blender
|
Iterator for pre-order (depth-first) traversal. More...
#include <Iterators.h>
Public Member Functions | |
PreOrderIterator () | |
PreOrderIterator (Node &node) | |
~PreOrderIterator () | |
PreOrderIterator (const PreOrderIterator &)=delete | |
PreOrderIterator (PreOrderIterator &&) | |
auto | operator!= (const PreOrderIterator &) const -> bool |
auto | operator* () -> Node & |
auto | operator++ () -> PreOrderIterator & |
Iterator for pre-order (depth-first) traversal.
Although recursion based algorithms are simple to understand (much simpler than the internals of this iterator at least), iteration based algorithms are often simpler to use, more readable (no need for lambdas or separate functions) and can minimize stack usage. This iterator tries to give all of these benefits.
Stack memory should not be a concern with this iterator. It only stores a few bytes for the current item. However it does allocate a bit of heap memory to keep information about visited ancestors up to the root of iteration. Even that only adds trivial overhead though.
bWidgets::bwScreenGraph::PreOrderIterator::PreOrderIterator | ( | ) |
bWidgets::bwScreenGraph::PreOrderIterator::PreOrderIterator | ( | Node & | node | ) |
bWidgets::bwScreenGraph::PreOrderIterator::~PreOrderIterator | ( | ) |
|
delete |
bWidgets::bwScreenGraph::PreOrderIterator::PreOrderIterator | ( | PreOrderIterator && | other | ) |
auto bWidgets::bwScreenGraph::PreOrderIterator::operator!= | ( | const PreOrderIterator & | other | ) | const -> bool |
auto bWidgets::bwScreenGraph::PreOrderIterator::operator* | ( | ) | -> Node& |
auto bWidgets::bwScreenGraph::PreOrderIterator::operator++ | ( | ) | -> PreOrderIterator& |
Node* bWidgets::bwScreenGraph::PreOrderIterator::node |
Node::ChildList::iterator bWidgets::bwScreenGraph::PreOrderIterator::node_iter |