liborigin 2.0.0

Public Member Functions | Public Attributes | Private Member Functions | List of all members
tree< T, tree_node_allocator >::fixed_depth_iterator Class Reference

Iterator which traverses only the nodes at a given depth from the root. More...

`#include <tree.hh>`

Inheritance diagram for tree< T, tree_node_allocator >::fixed_depth_iterator:

## Public Member Functions
| fixed_depth_iterator ()
| fixed_depth_iterator (const fixed_depth_iterator &)
| fixed_depth_iterator (const iterator_base &)
| fixed_depth_iterator (const sibling_iterator &)
| fixed_depth_iterator (tree_node *)
bool | operator!= (const fixed_depth_iterator &) const
fixed_depth_iterator & | operator++ ()
fixed_depth_iterator | operator++ (int)
fixed_depth_iterator & | operator+= (unsigned int)
fixed_depth_iterator & | operator-- ()
fixed_depth_iterator | operator-- (int)
fixed_depth_iterator & | operator-= (unsigned int)
bool | operator== (const fixed_depth_iterator &) const
Public Member Functions inherited from tree< T, tree_node_allocator >::iterator_base
sibling_iterator | begin () const
sibling_iterator | end () const
| iterator_base ()
| iterator_base (tree_node *)
unsigned int | number_of_children () const
| Number of children of the node pointed to by the iterator. More...
T & | operator* () const
T * | operator-> () const
void | skip_children ()
| When called, the next increment/decrement skips children of this node. More...

## Public Attributes
tree_node * | first_parent_
Public Attributes inherited from tree< T, tree_node_allocator >::iterator_base
tree_node * | node

## Private Member Functions
void | find_leftmost_parent_ ()
void | set_first_parent_ ()

## Additional Inherited Members
Public Types inherited from tree< T, tree_node_allocator >::iterator_base
typedef ptrdiff_t | difference_type
typedef std::bidirectional_iterator_tag | iterator_category
typedef T * | pointer
typedef T & | reference
typedef size_t | size_type
typedef T | value_type
Protected Attributes inherited from tree< T, tree_node_allocator >::iterator_base
bool | skip_current_children_

## Detailed Description

template<class T, class tree_node_allocator = std::allocator<tree_node_<T> >>
class tree< T, tree_node_allocator >::fixed_depth_iterator

Iterator which traverses only the nodes at a given depth from the root.

## Constructor & Destructor Documentation

## ◆ fixed_depth_iterator() [1/5]

template<class T , class tree_node_allocator >

tree< T, tree_node_allocator >::fixed_depth_iterator::fixed_depth_iterator

References tree< T, tree_node_allocator >::fixed_depth_iterator::set_first_parent_().

## ◆ fixed_depth_iterator() [2/5]

template<class T , class tree_node_allocator >

tree< T, tree_node_allocator >::fixed_depth_iterator::fixed_depth_iterator | ( | tree_node * | tn | ) |

References tree< T, tree_node_allocator >::fixed_depth_iterator::set_first_parent_().

## ◆ fixed_depth_iterator() [3/5]

template<class T , class tree_node_allocator >

tree< T, tree_node_allocator >::fixed_depth_iterator::fixed_depth_iterator | ( | const iterator_base & | other | ) |

References tree< T, tree_node_allocator >::fixed_depth_iterator::set_first_parent_().

## ◆ fixed_depth_iterator() [4/5]

template<class T , class tree_node_allocator >

tree< T, tree_node_allocator >::fixed_depth_iterator::fixed_depth_iterator | ( | const sibling_iterator & | other | ) |

References tree< T, tree_node_allocator >::fixed_depth_iterator::find_leftmost_parent_().

## ◆ fixed_depth_iterator() [5/5]

template<class T , class tree_node_allocator >

tree< T, tree_node_allocator >::fixed_depth_iterator::fixed_depth_iterator | ( | const fixed_depth_iterator & | other | ) |

## Member Function Documentation

## ◆ find_leftmost_parent_()

template<class T , class tree_node_allocator >

void tree< T, tree_node_allocator >::fixed_depth_iterator::find_leftmost_parent_
| private

References tree_node_< T >::first_child, and tree_node_< T >::prev_sibling.

Referenced by tree< T, tree_node_allocator >::fixed_depth_iterator::fixed_depth_iterator().

## ◆ operator!=()

template<class T , class tree_node_allocator >

bool tree< T, tree_node_allocator >::fixed_depth_iterator::operator!= | ( | const fixed_depth_iterator & | other | ) | const

References tree< T, tree_node_allocator >::fixed_depth_iterator::first_parent_, and tree< T, tree_node_allocator >::iterator_base::node.

## ◆ operator++() [1/2]

template<class T , class tree_node_allocator >

tree< T, tree_node_allocator >::fixed_depth_iterator & tree< T, tree_node_allocator >::fixed_depth_iterator::operator++

## ◆ operator++() [2/2]

template<class T , class tree_node_allocator >

tree< T, tree_node_allocator >::fixed_depth_iterator tree< T, tree_node_allocator >::fixed_depth_iterator::operator++ | ( | int |  | ) |

## ◆ operator+=()

template<class T , class tree_node_allocator >

tree< T, tree_node_allocator >::fixed_depth_iterator & tree< T, tree_node_allocator >::fixed_depth_iterator::operator+= | ( | unsigned int | num | ) |

## ◆ operator--() [1/2]

template<class T , class tree_node_allocator >

tree< T, tree_node_allocator >::fixed_depth_iterator & tree< T, tree_node_allocator >::fixed_depth_iterator::operator--

References tree_node_< T >::last_child, tree_node_< T >::parent, and tree_node_< T >::prev_sibling.

## ◆ operator--() [2/2]

template<class T , class tree_node_allocator >

tree< T, tree_node_allocator >::fixed_depth_iterator tree< T, tree_node_allocator >::fixed_depth_iterator::operator-- | ( | int |  | ) |

## ◆ operator-=()

template<class T , class tree_node_allocator >

tree< T, tree_node_allocator >::fixed_depth_iterator & tree< T, tree_node_allocator >::fixed_depth_iterator::operator-= | ( | unsigned int | num | ) |

## ◆ operator==()

template<class T , class tree_node_allocator >

bool tree< T, tree_node_allocator >::fixed_depth_iterator::operator== | ( | const fixed_depth_iterator & | other | ) | const

References tree< T, tree_node_allocator >::fixed_depth_iterator::first_parent_, and tree< T, tree_node_allocator >::iterator_base::node.

## ◆ set_first_parent_()

template<class T , class tree_node_allocator >

void tree< T, tree_node_allocator >::fixed_depth_iterator::set_first_parent_
| private

Referenced by tree< T, tree_node_allocator >::fixed_depth_iterator::fixed_depth_iterator().

## Member Data Documentation

## ◆ first_parent_

template<class T , class tree_node_allocator = std::allocator<tree_node_<T> >>

tree_node* tree< T, tree_node_allocator >::fixed_depth_iterator::first_parent_

Referenced by tree< T, tree_node_allocator >::fixed_depth_iterator::operator!=(), and tree< T, tree_node_allocator >::fixed_depth_iterator::operator==().

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

- /tmp/slackdce/slackrepo.5NA6jZ/build_liborigin/liborigin/tree.hh