![]() |
ucx
UAP Common Extensions
|
A breadth-first tree iterator. More...
#include <tree.h>
Data Fields | |
struct cx_iterator_base_s | base |
Base members. | |
bool | skip |
Indicates whether the subtree below the current node shall be skipped. | |
ptrdiff_t | loc_children |
Offset in the node struct for the children linked list. | |
ptrdiff_t | loc_next |
Offset in the node struct for the next pointer. | |
size_t | counter |
The total number of distinct nodes that have been passed so far. | |
void * | node |
The currently observed node. | |
size_t | depth |
The current depth in the tree. | |
struct cx_tree_visitor_queue_s * | queue_next |
The next element in the visitor queue. | |
struct cx_tree_visitor_queue_s * | queue_last |
The last element in the visitor queue. | |
A breadth-first tree iterator.
This iterator needs to maintain a visitor queue that will be automatically freed once the iterator becomes invalid. If you want to discard the iterator before, you MUST manually call cxTreeVisitorDispose().
This iterator is not position-aware in a strict sense, as it does not assume a particular order of elements in the tree. However, the iterator keeps track of the number of nodes it has passed in a counter variable. Each node, regardless of the number of passes, is counted only once.
void* cx_tree_visitor_s::node |
The currently observed node.
This is the same what cxIteratorCurrent() would return.