1 #ifndef GENESIS_TAXONOMY_ITERATOR_PREORDER_H_
2 #define GENESIS_TAXONOMY_ITERATOR_PREORDER_H_
62 std::function<
void(
Taxon& )> fn,
63 bool include_inner_taxa =
true
65 for(
auto& t : tax ) {
66 if( include_inner_taxa || t.size() == 0 ) {
86 std::function<
void(
Taxon const& )> fn,
87 bool include_inner_taxa =
true
89 for(
auto const& t : tax ) {
90 if( include_inner_taxa || t.size() == 0 ) {
102 template <
typename TaxonomyType,
typename TaxonType>
126 for(
size_t i = 0; i < taxonomy.size(); ++i ) {
127 stack_.push( &taxonomy.at( taxonomy.size() - 1 - i ));
152 auto cur_tax = stack_.top();
157 auto const cur_size = cur_tax->size();
158 for(
size_t i = 0; i < cur_size; ++i ) {
159 stack_.push( &cur_tax->at( cur_size - 1 - i ));
174 return other.stack_ == stack_;
179 return !(other == *
this);
188 return *stack_.top();
197 std::stack< TaxonType* > stack_;
204 template<
typename TaxonomyType>
214 template<
typename TaxonomyType>
227 #endif // include guard