A library for working with phylogenetic and population genetic data.
v0.27.0
IteratorPostorder< is_const > Class Template Reference

#include <genesis/tree/iterator/postorder.hpp>

Detailed Description

template<bool is_const = true>
class genesis::tree::IteratorPostorder< is_const >

Definition at line 61 of file tree/iterator/postorder.hpp.

Public Member Functions

 IteratorPostorder ()
 
 IteratorPostorder (IteratorPostorder &&)=default
 
 IteratorPostorder (IteratorPostorder const &)=default
 
 IteratorPostorder (LinkType &link)
 Start a postorder traversal at a given TreeLink, moving in the direction of the link first. More...
 
 IteratorPostorder (NodeType &node)
 Start a postorder traversal at the given TreeNode, moving in the root direction first. More...
 
 IteratorPostorder (Subtree const &subtree)
 Start a postorder traversal at the top TreeNode of a Subtree, only traversing the nodes in the subtree. More...
 
 IteratorPostorder (TreeType &tree)
 Start a postorder traversal at the root of the given Tree. More...
 
 ~IteratorPostorder ()=default
 
EdgeTypeedge () const
 
bool is_last_iteration () const
 
LinkTypelink () const
 
NodeTypenode () const
 
bool operator!= (const self_type &other) const
 
self_type operator* ()
 
self_type operator++ ()
 
self_type operator++ (int)
 
IteratorPostorderoperator= (IteratorPostorder &&)=default
 
IteratorPostorderoperator= (IteratorPostorder const &)=default
 
bool operator== (const self_type &other) const
 
LinkTypestart_link () const
 
NodeTypestart_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 = IteratorPostorder< is_const >
 
using TreeType = typename std::conditional< is_const, Tree const, Tree >::type
 

Constructor & Destructor Documentation

◆ IteratorPostorder() [1/7]

IteratorPostorder ( )
inline

Definition at line 87 of file tree/iterator/postorder.hpp.

◆ IteratorPostorder() [2/7]

IteratorPostorder ( TreeType tree)
inlineexplicit

Start a postorder traversal at the root of the given Tree.

Definition at line 95 of file tree/iterator/postorder.hpp.

◆ IteratorPostorder() [3/7]

IteratorPostorder ( NodeType node)
inlineexplicit

Start a postorder traversal at the given TreeNode, moving in the root direction first.

The iterator "starts" that the given TreeNode (for a postorder traversal, starting means that this will be the last node visited). It first traverses in the direction towards the root, until a leaf is found. This leaf is the first node being visited. From there on, the traversal continues as usual.

Definition at line 107 of file tree/iterator/postorder.hpp.

◆ IteratorPostorder() [4/7]

IteratorPostorder ( LinkType link)
inlineexplicit

Start a postorder traversal at a given TreeLink, moving in the direction of the link first.

The iterator "starts" that the TreeNode of the given link (for a postorder traversal, starting means that this will be the last node visited). It first traverses in the direction of the outer() link of the given link, until a leaf is found. This leaf is the first node being visited. From there on, the traversal continues as usual.

Definition at line 120 of file tree/iterator/postorder.hpp.

◆ IteratorPostorder() [5/7]

IteratorPostorder ( Subtree const &  subtree)
inlineexplicit

Start a postorder traversal at the top TreeNode of a Subtree, only traversing the nodes in the subtree.

Definition at line 153 of file tree/iterator/postorder.hpp.

◆ ~IteratorPostorder()

~IteratorPostorder ( )
default

◆ IteratorPostorder() [6/7]

IteratorPostorder ( IteratorPostorder< is_const > const &  )
default

◆ IteratorPostorder() [7/7]

IteratorPostorder ( IteratorPostorder< is_const > &&  )
default

Member Function Documentation

◆ edge()

EdgeType& edge ( ) const
inline

Definition at line 261 of file tree/iterator/postorder.hpp.

◆ is_last_iteration()

bool is_last_iteration ( ) const
inline

Definition at line 246 of file tree/iterator/postorder.hpp.

◆ link()

LinkType& link ( ) const
inline

Definition at line 251 of file tree/iterator/postorder.hpp.

◆ node()

NodeType& node ( ) const
inline

Definition at line 256 of file tree/iterator/postorder.hpp.

◆ operator!=()

bool operator!= ( const self_type other) const
inline

Definition at line 237 of file tree/iterator/postorder.hpp.

◆ operator*()

self_type operator* ( )
inline

Definition at line 189 of file tree/iterator/postorder.hpp.

◆ operator++() [1/2]

self_type operator++ ( )
inline

Definition at line 194 of file tree/iterator/postorder.hpp.

◆ operator++() [2/2]

self_type operator++ ( int  )
inline

Definition at line 225 of file tree/iterator/postorder.hpp.

◆ operator=() [1/2]

IteratorPostorder& operator= ( IteratorPostorder< is_const > &&  )
default

◆ operator=() [2/2]

IteratorPostorder& operator= ( IteratorPostorder< is_const > const &  )
default

◆ operator==()

bool operator== ( const self_type other) const
inline

Definition at line 232 of file tree/iterator/postorder.hpp.

◆ start_link()

LinkType& start_link ( ) const
inline

Definition at line 266 of file tree/iterator/postorder.hpp.

◆ start_node()

NodeType& start_node ( ) const
inline

Definition at line 271 of file tree/iterator/postorder.hpp.

Member Typedef Documentation

◆ EdgeType

using EdgeType = typename std::conditional< is_const, TreeEdge const, TreeEdge >::type

Definition at line 74 of file tree/iterator/postorder.hpp.

◆ iterator_category

using iterator_category = std::forward_iterator_tag

Definition at line 77 of file tree/iterator/postorder.hpp.

◆ LinkType

using LinkType = typename std::conditional< is_const, TreeLink const, TreeLink >::type

Definition at line 72 of file tree/iterator/postorder.hpp.

◆ NodeType

using NodeType = typename std::conditional< is_const, TreeNode const, TreeNode >::type

Definition at line 73 of file tree/iterator/postorder.hpp.

◆ self_type

using self_type = IteratorPostorder< is_const >

Definition at line 76 of file tree/iterator/postorder.hpp.

◆ TreeType

using TreeType = typename std::conditional< is_const, Tree const, Tree >::type

Definition at line 71 of file tree/iterator/postorder.hpp.


The documentation for this class was generated from the following file: