27 #ifndef MLN_UTIL_BRANCH_ITER_IND_HH
28 # define MLN_UTIL_BRANCH_ITER_IND_HH
38 # include <mln/util/tree.hh>
98 std::stack< bi_elt<T> > s_;
103 # ifndef MLN_INCLUDE_ONLY
106 template <
typename T>
114 template <
typename T>
122 template <
typename T>
131 template <
typename T>
136 mln_assertion(is_valid());
138 tree_node<T>*
p = n_;
147 template <
typename T>
155 template <
typename T>
164 template <
typename T>
169 s_.push(bi_elt<T>(&branch_.apex().children()));
171 n_ = &branch_.apex();
174 template <
typename T>
187 if (s_.top().list_->size() == (
unsigned)s_.top().pos_)
195 mln_assertion(s_.top().list_->size() > (
unsigned)s_.top().pos_);
196 if (s_.top().previous_ != 0)
197 mln_assertion(s_.top().previous_ == (*(s_.top().list_))[s_.top().pos_ - 1]);
199 n_ = (*(s_.top().list_))[s_.top().pos_];
200 s_.top().previous_ = n_;
209 if (n_->children().size() > 0)
211 s_.push(bi_elt<T>(&n_->children()));
218 # endif // ! MLN_INCLUDE_ONLY
226 #endif // ! MLN_UTIL_BRANCH_ITER_IND_HH