26 #ifndef MLN_UTIL_BRANCH_ITER_HH
27 # define MLN_UTIL_BRANCH_ITER_HH
37 # include <mln/util/tree.hh>
79 typedef typename std::vector< util::tree_node<T>* >::iterator child_iter;
80 typedef std::pair<child_iter, child_iter> iter_pair;
82 std::stack< iter_pair > s_;
88 # ifndef MLN_INCLUDE_ONLY
107 template <
typename T>
116 template <
typename T>
121 mln_assertion(is_valid());
132 template <
typename T>
140 template <
typename T>
149 template <
typename T>
154 s_.push(iter_pair(branch_.apex().children().begin(),
155 branch_.apex().children().end()));
156 n_ = &branch_.apex();
159 template <
typename T>
168 if (s_.top().first == s_.top().second)
176 n_ = *(s_.top().first);
186 if (n_->children().size() > 0)
188 s_.push(iter_pair(n_->children().begin(),
189 n_->children().end()));
196 # endif // ! MLN_INCLUDE_ONLY
204 #endif // ! MLN_UTIL_BRANCH_ITER_HH