|
A library for working with phylogenetic and population genetic data.
v0.27.0
|
|
Go to the documentation of this file. 1 #ifndef GENESIS_TREE_ITERATOR_NODE_LINKS_H_
2 #define GENESIS_TREE_ITERATOR_NODE_LINKS_H_
38 #include <type_traits>
56 template<
bool is_const = true >
67 using TreeType =
typename std::conditional< is_const, Tree const, Tree >::type;
68 using LinkType =
typename std::conditional< is_const, TreeLink const, TreeLink >::type;
69 using NodeType =
typename std::conditional< is_const, TreeNode const, TreeNode >::type;
70 using EdgeType =
typename std::conditional< is_const, TreeEdge const, TreeEdge >::type;
89 : start_( &
node.primary_link() )
90 , link_( &
node.primary_link() )
117 link_ = &link_->next();
118 if (link_ == start_) {
133 return other.link_ == link_;
138 return !(other == *
this);
147 return link_ == start_;
157 return link_->node();
162 return link_->edge();
184 template<
typename ElementType>
194 template<
typename ElementType>
207 #endif // include guard
IteratorNodeLinks(NodeType &node)
bool is_first_iteration() const
IteratorNodeLinks & operator=(IteratorNodeLinks const &)=default
std::forward_iterator_tag iterator_category
utils::Range< IteratorNodeLinks< true > > node_links(ElementType const &element)
typename std::conditional< is_const, TreeLink const, TreeLink >::type LinkType
Simple wrapper for typical begin() and end() iterators, to be used in range-based for loops.
Container namespace for all symbols of genesis in order to keep them separate when used as a library.
bool operator==(const self_type &other) const
LinkType & start_link() const
typename std::conditional< is_const, TreeNode const, TreeNode >::type NodeType
IteratorNodeLinks(LinkType &link)
typename std::conditional< is_const, Tree const, Tree >::type TreeType
~IteratorNodeLinks()=default
bool operator!=(const self_type &other) const
typename std::conditional< is_const, TreeEdge const, TreeEdge >::type EdgeType