Algorithms Library Toolkit
A toolkit for algorithms, especially for algorithms on formal languages
|
The iterator type over structure of the tree representing nodes and node_ends. More...
#include <tree.hpp>
Public Types | |
using | difference_type = std::ptrdiff_t |
using | value_type = T |
using | pointer = const T * |
using | reference = const T & |
using | iterator_category = std::bidirectional_iterator_tag |
Public Member Functions | |
const_structure_iterator (const tree *n) | |
Constructor of the iterator based on the iterator to child list. More... | |
const_structure_iterator & | operator++ () |
Advance the iterator. More... | |
const_structure_iterator | operator++ (int) |
Advance the iterator. More... | |
const_structure_iterator & | operator-- () |
Retract the iterator. More... | |
const_structure_iterator | operator-- (int) |
Retract the iterator. More... | |
bool | operator== (const const_structure_iterator &other) const |
Compare the iterators for equality. More... | |
bool | operator!= (const const_structure_iterator &other) const |
Compare the iterators for nonequality. More... | |
const T & | operator* () const |
Dereference the iterator by accessing the pointed node value. More... | |
const T * | operator-> () const |
Dereference the iterator by accessing the pointed node value. More... | |
size_t | getLevel () const |
Retrieves what is the depth of node the iterator is pointing to. More... | |
bool | getVirtual () const |
Allows to distinguish entry or leave visit of a pointed to node. More... | |
Friends | |
template<class F > | |
class | tree |
The iterator type over structure of the tree representing nodes and node_ends.
The iterator performs a top to bottom, left to right or depth first travrsal stopping at each node twice. Once as it enters it the first time and second time when it leaves it (on the way to its parent).
using ext::tree< T >::const_structure_iterator::difference_type = std::ptrdiff_t |
using ext::tree< T >::const_structure_iterator::iterator_category = std::bidirectional_iterator_tag |
using ext::tree< T >::const_structure_iterator::pointer = const T* |
using ext::tree< T >::const_structure_iterator::reference = const T& |
using ext::tree< T >::const_structure_iterator::value_type = T |
|
inline |
Constructor of the iterator based on the iterator to child list.
n | the iterator to child list |
|
inline |
Retrieves what is the depth of node the iterator is pointing to.
|
inline |
Allows to distinguish entry or leave visit of a pointed to node.
|
inline |
Compare the iterators for nonequality.
other | the other instance |
|
inline |
Dereference the iterator by accessing the pointed node value.
|
inline |
Advance the iterator.
|
inline |
Advance the iterator.
|
inline |
Retract the iterator.
|
inline |
Retract the iterator.
|
inline |
Dereference the iterator by accessing the pointed node value.
|
inline |
Compare the iterators for equality.
other | the other instance |