liborigin2: tree< T, tree_node_allocator >::sibling_iterator Class Reference

liborigin2 29/08/2011

- Main Page
- Related Pages
- Namespaces
- Classes
- Files

- Class List
- Class Index
- Class Hierarchy
- Class Members

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

Iterator which traverses only the nodes which are siblings of each other. More...

`#include <tree.hh>`

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

## Public Member Functions
bool | operator!= (const sibling_iterator &) const
sibling_iterator & | operator++ ()
sibling_iterator | operator++ (int)
sibling_iterator & | operator+= (unsigned int)
sibling_iterator & | operator-- ()
sibling_iterator | operator-- (int)
sibling_iterator & | operator-= (unsigned int)
bool | operator== (const sibling_iterator &) const
tree_node * | range_first () const
tree_node * | range_last () const
| sibling_iterator ()
| sibling_iterator (tree_node *)
| sibling_iterator (const sibling_iterator &)
| sibling_iterator (const iterator_base &)
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...
void | skip_children (bool skip)

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

## Private Member Functions
void | set_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 >::sibling_iterator

Iterator which traverses only the nodes which are siblings of each other.

## Constructor & Destructor Documentation

template<class T , class tree_node_allocator >

tree< T, tree_node_allocator >::sibling_iterator::sibling_iterator | ( |  | ) |

References tree< T, tree_node_allocator >::sibling_iterator::set_parent_().

template<class T , class tree_node_allocator >

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

References tree< T, tree_node_allocator >::sibling_iterator::set_parent_().

template<class T , class tree_node_allocator >

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

template<class T , class tree_node_allocator >

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

References tree< T, tree_node_allocator >::sibling_iterator::set_parent_().

## Member Function Documentation

template<class T , class tree_node_allocator >

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

References tree< T, tree_node_allocator >::iterator_base::node.

template<class T , class tree_node_allocator >

tree< T, tree_node_allocator >::sibling_iterator & tree< T, tree_node_allocator >::sibling_iterator::operator++ | ( |  | ) |

template<class T , class tree_node_allocator >

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

template<class T , class tree_node_allocator >

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

template<class T , class tree_node_allocator >

tree< T, tree_node_allocator >::sibling_iterator & tree< T, tree_node_allocator >::sibling_iterator::operator-- | ( |  | ) |

template<class T , class tree_node_allocator >

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

template<class T , class tree_node_allocator >

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

template<class T , class tree_node_allocator >

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

References tree< T, tree_node_allocator >::iterator_base::node.

template<class T , class tree_node_allocator >

tree< T, tree_node_allocator >::tree_node * tree< T, tree_node_allocator >::sibling_iterator::range_first | ( |  | ) | const

References tree_node_< T >::first_child.

template<class T , class tree_node_allocator >

tree< T, tree_node_allocator >::tree_node * tree< T, tree_node_allocator >::sibling_iterator::range_last | ( |  | ) | const

References tree_node_< T >::last_child.

Referenced by tree< T, tree_node_allocator >::insert(), tree< T, tree_node_allocator >::leaf_iterator::leaf_iterator(), tree< T, tree_node_allocator >::post_order_iterator::post_order_iterator(), and tree< T, tree_node_allocator >::pre_order_iterator::pre_order_iterator().

template<class T , class tree_node_allocator >

void tree< T, tree_node_allocator >::sibling_iterator::set_parent_ | ( |  | ) |
| private

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

## Member Data Documentation

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

tree_node* tree< T, tree_node_allocator >::sibling_iterator::parent_

Referenced by tree< T, tree_node_allocator >::iterator_base::begin(), tree< T, tree_node_allocator >::iterator_base::end(), tree< T, tree_node_allocator >::end(), tree< T, tree_node_allocator >::insert(), tree< T, tree_node_allocator >::leaf_iterator::leaf_iterator(), tree< T, tree_node_allocator >::move_before(), tree< T, tree_node_allocator >::post_order_iterator::post_order_iterator(), and tree< T, tree_node_allocator >::pre_order_iterator::pre_order_iterator().

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

- /build/liborigin2/src/liborigin2/tree.hh