bWidgets
Core widget toolkit designed for Blender
bWidgets::bwScreenGraph::PreOrderIterator Class Reference

Iterator for pre-order (depth-first) traversal. More...

#include <Iterators.h>

+ Collaboration diagram for bWidgets::bwScreenGraph::PreOrderIterator:

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 &
 

Detailed Description

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.

Constructor & Destructor Documentation

◆ PreOrderIterator() [1/4]

bWidgets::bwScreenGraph::PreOrderIterator::PreOrderIterator ( )

◆ PreOrderIterator() [2/4]

bWidgets::bwScreenGraph::PreOrderIterator::PreOrderIterator ( Node node)

◆ ~PreOrderIterator()

bWidgets::bwScreenGraph::PreOrderIterator::~PreOrderIterator ( )

◆ PreOrderIterator() [3/4]

bWidgets::bwScreenGraph::PreOrderIterator::PreOrderIterator ( const PreOrderIterator )
delete

◆ PreOrderIterator() [4/4]

bWidgets::bwScreenGraph::PreOrderIterator::PreOrderIterator ( PreOrderIterator &&  other)

Member Function Documentation

◆ operator!=()

auto bWidgets::bwScreenGraph::PreOrderIterator::operator!= ( const PreOrderIterator other) const -> bool

◆ operator*()

auto bWidgets::bwScreenGraph::PreOrderIterator::operator* ( ) -> Node&

◆ operator++()

auto bWidgets::bwScreenGraph::PreOrderIterator::operator++ ( ) -> PreOrderIterator&

Member Data Documentation

◆ node

Node* bWidgets::bwScreenGraph::PreOrderIterator::node

◆ node_iter

Node::ChildList::iterator bWidgets::bwScreenGraph::PreOrderIterator::node_iter

The documentation for this class was generated from the following files: