#include <genesis/tree/iterator/path.hpp>
Public Member Functions | |
IteratorPath () | |
IteratorPath (IteratorPath &&)=default | |
IteratorPath (IteratorPath const &)=default | |
IteratorPath (LinkType &start, LinkType &finish) | |
IteratorPath (NodeType &start, NodeType &finish) | |
~IteratorPath ()=default | |
EdgeType & | edge () const |
LinkType & | finish_link () const |
NodeType & | finish_node () const |
bool | is_last_common_ancestor () const |
Return whether the current iterator position (node) is the last common ancestor of the two start and finish nodes. More... | |
bool | is_lca () const |
Alias for is_last_common_ancestor(). See there for more information. More... | |
LinkType & | link () const |
NodeType & | node () const |
bool | operator!= (const self_type &other) const |
self_type | operator* () |
self_type | operator++ () |
self_type | operator++ (int) |
IteratorPath & | operator= (IteratorPath &&)=default |
IteratorPath & | operator= (IteratorPath const &)=default |
bool | operator== (const self_type &other) const |
LinkType & | start_link () const |
NodeType & | start_node () const |
Public Types | |
using | EdgeType = typename std::conditional< is_const, TreeEdge const, TreeEdge >::type |
using | iterator_category = std::forward_iterator_tag |
using | LinkType = typename std::conditional< is_const, TreeLink const, TreeLink >::type |
using | NodeType = typename std::conditional< is_const, TreeNode const, TreeNode >::type |
using | self_type = IteratorPath< is_const > |
using | TreeType = typename std::conditional< is_const, Tree const, Tree >::type |
|
inline |
|
inline |
|
inline |
|
default |
|
default |
|
default |
|
inline |
Return whether the current iterator position (node) is the last common ancestor of the two start and finish nodes.
This is useful in many cases:
The last bullet point may need some explanation:
The iterator visits all nodes between the start and the finish (both included). On the path between them, there is however one edge fewer than the number of visited nodes. That means, if you want to visit each edge on the path between two nodes (instead of each node), you need a way to spot this superflous edge. This function indicates the edge that needs to be skipped in this case.
|
inline |
Alias for is_last_common_ancestor(). See there for more information.
|
default |
|
default |
using iterator_category = std::forward_iterator_tag |
using self_type = IteratorPath< is_const > |