Helios++
Helios software for LiDAR simulations
|
Fast depth first iterator for binary tree like nodes. More...
#include <BinaryTreeFastDepthIterator.h>
Public Member Functions | |
BinaryTreeFastDepthIterator ()=default | |
Default constructor for binary tree fast depth iterator. | |
BinaryTreeFastDepthIterator (NodeType *node) | |
Construct a binary tree fast depth iterator calling the start method with given node. More... | |
void | start (NodeType *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... | |
NodeType * | next () override |
Obtain the next node according to depth iteration criterion. More... | |
![]() | |
ITreeIterator ()=default | |
Default constructor for tree iterator. | |
Protected Attributes | |
deque< IBinaryTreeNode * > | pendingNodes |
Double ended queue used as a stack to handle nodes visiting. | |
Private Member Functions | |
template<class Archive > | |
void | serialize (Archive &ar, const unsigned int version) |
Serialize a BinaryTreeFastDepthIterator to a stream of bytes. More... | |
Friends | |
class | boost::serialization::access |
Fast depth first iterator for binary tree like nodes.
Depth first node visiting order is illustrated below:
0 | |||||||||||||||||||||
1 | 4 | ||||||||||||||||||||
2 | 3 | 5 | 6 |
NodeType | Type of binary tree node. It must correspond to a class which extends IBinaryTreeNode interface |
|
inline |
Construct a binary tree fast depth iterator calling the start method with given node.
node | Node to start depth iterating from |
|
inlineoverridevirtual |
Check if the iterator has more nodes to visit (true) or not (false)
Implements ITreeIterator< NodeType * >.
|
inlineoverridevirtual |
Obtain the next node according to depth iteration criterion.
Implements ITreeIterator< NodeType * >.
|
inlineprivate |
Serialize a BinaryTreeFastDepthIterator to a stream of bytes.
Archive | Type of rendering |
ar | Specific rendering for the stream of bytes |
version | Version number for the BinaryTreeFastDepthIterator |
|
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< NodeType * >.