27 #ifndef MLN_UTIL_BRANCH_ITER_HH
28 # define MLN_UTIL_BRANCH_ITER_HH
38 # include <mln/util/tree.hh>
82 typedef typename std::vector< util::tree_node<T>* >::iterator child_iter;
83 typedef std::pair<child_iter, child_iter> iter_pair;
85 std::stack< iter_pair > s_;
91 # ifndef MLN_INCLUDE_ONLY
102 template <
typename T>
110 template <
typename T>
119 template <
typename T>
124 mln_assertion(is_valid());
126 tree_node<T>*
p = n_;
135 template <
typename T>
143 template <
typename T>
152 template <
typename T>
157 s_.push(iter_pair(branch_.apex().children().begin(),
158 branch_.apex().children().end()));
159 n_ = &branch_.apex();
162 template <
typename T>
171 if (s_.top().first == s_.top().second)
179 n_ = *(s_.top().first);
189 if (n_->children().size() > 0)
191 s_.push(iter_pair(n_->children().begin(),
192 n_->children().end()));
199 # endif // ! MLN_INCLUDE_ONLY
207 #endif // ! MLN_UTIL_BRANCH_ITER_HH