#include <branch_iter.hh>
Public Member Functions | |
| branch_iter (branch< T > branch) | |
| unsigned | deepness () const |
| Give how deep is the iterator in the branch. | |
| void | invalidate () |
| Invalidate the iterator. | |
| bool | is_valid () const |
| Test the iterator validity. | |
| void | next () |
| Go to the next point. | |
| operator util::tree_node< T > & () const | |
| Conversion to node. | |
| util::tree_node< T > & | operator* () |
| void | start () |
| Start an iteration. | |
Private Types | |
| typedef std::vector < util::tree_node< T > * >::iterator | child_iter |
| typedef std::pair< child_iter, child_iter > | iter_pair |
Private Attributes | |
| util::branch< T > | branch_ |
| The branch to iter. | |
| util::tree_node< T > * | n_ |
| std::stack< iter_pair > | s_ |
| Store child().begin() and child().end(). | |
The parameter T is the type of node's data. branch_iter is used to pre-order walk a branch.
Definition at line 52 of file branch_iter.hh.
typedef std::vector< util::tree_node<T>* >::iterator mln::util::branch_iter< T >::child_iter [private] |
Definition at line 79 of file branch_iter.hh.
typedef std::pair<child_iter, child_iter> mln::util::branch_iter< T >::iter_pair [private] |
Definition at line 80 of file branch_iter.hh.
| mln::util::branch_iter< T >::branch_iter | ( | branch< T > | branch | ) | [inline] |
| unsigned mln::util::branch_iter< T >::deepness | ( | ) | const [inline] |
Give how deep is the iterator in the branch.
Definition at line 119 of file branch_iter.hh.
References mln::util::branch_iter< T >::is_valid(), mln::util::branch_iter< T >::n_, and mln::util::tree_node< T >::parent().
| void mln::util::branch_iter< T >::invalidate | ( | ) | [inline] |
Invalidate the iterator.
Definition at line 143 of file branch_iter.hh.
References mln::util::branch_iter< T >::n_.
Referenced by mln::util::branch_iter< T >::branch_iter(), and mln::util::branch_iter< T >::next().
| bool mln::util::branch_iter< T >::is_valid | ( | ) | const [inline] |
Test the iterator validity.
Definition at line 135 of file branch_iter.hh.
References mln::util::branch_iter< T >::n_.
Referenced by mln::util::branch_iter< T >::deepness().
| void mln::util::branch_iter< T >::next | ( | ) | [inline] |
Go to the next point.
Definition at line 162 of file branch_iter.hh.
References mln::util::branch_iter< T >::invalidate(), mln::util::branch_iter< T >::n_, and mln::util::branch_iter< T >::s_.
| mln::util::branch_iter< T >::operator util::tree_node< T > & | ( | ) | const [inline] |
Conversion to node.
Definition at line 101 of file branch_iter.hh.
References mln::util::branch_iter< T >::n_.
| util::tree_node< T > & mln::util::branch_iter< T >::operator* | ( | ) | [inline] |
| void mln::util::branch_iter< T >::start | ( | ) | [inline] |
Start an iteration.
Definition at line 152 of file branch_iter.hh.
References mln::util::branch_iter< T >::branch_, mln::util::branch_iter< T >::n_, and mln::util::branch_iter< T >::s_.
util::branch<T> mln::util::branch_iter< T >::branch_ [private] |
The branch to iter.
Definition at line 77 of file branch_iter.hh.
Referenced by mln::util::branch_iter< T >::start().
util::tree_node<T>* mln::util::branch_iter< T >::n_ [private] |
Definition at line 84 of file branch_iter.hh.
Referenced by mln::util::branch_iter< T >::deepness(), mln::util::branch_iter< T >::invalidate(), mln::util::branch_iter< T >::is_valid(), mln::util::branch_iter< T >::next(), mln::util::branch_iter< T >::operator util::tree_node< T > &(), mln::util::branch_iter< T >::operator*(), and mln::util::branch_iter< T >::start().
std::stack< iter_pair > mln::util::branch_iter< T >::s_ [private] |
Store child().begin() and child().end().
Definition at line 82 of file branch_iter.hh.
Referenced by mln::util::branch_iter< T >::next(), and mln::util::branch_iter< T >::start().
1.5.6