Helios++
Helios software for LiDAR simulations
|
Like fast breadth first iterator but wrapping tree nodes inside a IterableTreeNode instance. More...
#include <BinaryTreeBreadthIterator.h>
Public Member Functions | |
BinaryTreeBreadthIterator ()=default | |
Default constructor for binary tree breadth iterator. | |
BinaryTreeBreadthIterator (NodeType *node, int const depth=0) | |
Construct a binary tree breadth iterator calling the start method with given node. More... | |
BinaryTreeBreadthIterator (IterableTreeNode< IBinaryTreeNode > node) | |
Construct a binary tree breadth iterator calling the start method with given iterable tree node. More... | |
void | start (NodeType *node, int const depth=0) |
void | start (IterableTreeNode< IBinaryTreeNode > node) override |
Start the iterator so the first visited node will be given one. It is, when calling next, given node will be returned. More... | |
bool | hasNext () const override |
Check if the iterator has more nodes to visit (true) or not (false) More... | |
IterableTreeNode< IBinaryTreeNode > | next () override |
Obtain the next node according to breadth iteration criterion. More... | |
![]() | |
ITreeIterator ()=default | |
Default constructor for tree iterator. | |
Protected Attributes | |
deque< IterableTreeNode< IBinaryTreeNode > > | pendingNodes |
Double ended queue used as a queue to handle nodes visiting. | |
Private Member Functions | |
template<class Archive > | |
void | serialize (Archive &ar, unsigned int const version) |
Serialize a BinaryTreeBreadthIterator to a stream of bytes. More... | |
Friends | |
class | boost::serialization::access |
Like fast breadth first iterator but wrapping tree nodes inside a IterableTreeNode instance.
NodeType | Type of binary tree node. It must correspond to a class which extends IBinaryTreeNode interface |
|
inline |
Construct a binary tree breadth iterator calling the start method with given node.
node | Node to start breadth iterating from |
depth | The depth at which given node is said to be located |
|
inline |
Construct a binary tree breadth iterator calling the start method with given iterable tree node.
node | Iterable tree node to start breadth iterating from |
|
inlineoverridevirtual |
Check if the iterator has more nodes to visit (true) or not (false)
Implements ITreeIterator< IterableTreeNode< IBinaryTreeNode > >.
|
inlineoverridevirtual |
Obtain the next node according to breadth iteration criterion.
Implements ITreeIterator< IterableTreeNode< IBinaryTreeNode > >.
|
inlineprivate |
Serialize a BinaryTreeBreadthIterator to a stream of bytes.
Archive | Type of rendering |
ar | Specific rendering for the stream of bytes |
version | Version number for the BinaryTreeBreadthIterator |
|
inlineoverridevirtual |
Start the iterator so the first visited node will be given one. It is, when calling next, given node will be returned.
node | Node to start depth iterating from |
Implements ITreeIterator< IterableTreeNode< IBinaryTreeNode > >.
|
inline |
depth | The depth at which given node is said to be located |