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

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

Detailed Description

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

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

Public Member Functions

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

Constructor & Destructor Documentation

◆ IteratorPreorder() [1/7]

IteratorPreorder ( )
inline

Definition at line 88 of file tree/iterator/preorder.hpp.

◆ IteratorPreorder() [2/7]

IteratorPreorder ( TreeType tree)
inlineexplicit

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

Definition at line 96 of file tree/iterator/preorder.hpp.

◆ IteratorPreorder() [3/7]

IteratorPreorder ( NodeType node)
inlineexplicit

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

Definition at line 103 of file tree/iterator/preorder.hpp.

◆ IteratorPreorder() [4/7]

IteratorPreorder ( LinkType link)
inlineexplicit

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

Definition at line 110 of file tree/iterator/preorder.hpp.

◆ IteratorPreorder() [5/7]

IteratorPreorder ( SubtreeType subtree)
inlineexplicit

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

Definition at line 129 of file tree/iterator/preorder.hpp.

◆ ~IteratorPreorder()

~IteratorPreorder ( )
default

◆ IteratorPreorder() [6/7]

IteratorPreorder ( IteratorPreorder< is_const > const &  )
default

◆ IteratorPreorder() [7/7]

IteratorPreorder ( IteratorPreorder< is_const > &&  )
default

Member Function Documentation

◆ edge()

EdgeType& edge ( ) const
inline

Definition at line 211 of file tree/iterator/preorder.hpp.

◆ is_first_iteration()

bool is_first_iteration ( ) const
inline

Definition at line 196 of file tree/iterator/preorder.hpp.

◆ link()

LinkType& link ( ) const
inline

Definition at line 201 of file tree/iterator/preorder.hpp.

◆ node()

NodeType& node ( ) const
inline

Definition at line 206 of file tree/iterator/preorder.hpp.

◆ operator!=()

bool operator!= ( const self_type other) const
inline

Definition at line 187 of file tree/iterator/preorder.hpp.

◆ operator*()

self_type operator* ( )
inline

Definition at line 150 of file tree/iterator/preorder.hpp.

◆ operator++() [1/2]

self_type operator++ ( )
inline

Definition at line 155 of file tree/iterator/preorder.hpp.

◆ operator++() [2/2]

self_type operator++ ( int  )
inline

Definition at line 175 of file tree/iterator/preorder.hpp.

◆ operator=() [1/2]

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

◆ operator=() [2/2]

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

◆ operator==()

bool operator== ( const self_type other) const
inline

Definition at line 182 of file tree/iterator/preorder.hpp.

◆ start_link()

LinkType& start_link ( ) const
inline

Definition at line 216 of file tree/iterator/preorder.hpp.

◆ start_node()

NodeType& start_node ( ) const
inline

Definition at line 221 of file tree/iterator/preorder.hpp.

Member Typedef Documentation

◆ EdgeType

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

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

◆ iterator_category

using iterator_category = std::forward_iterator_tag

Definition at line 78 of file tree/iterator/preorder.hpp.

◆ LinkType

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

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

◆ NodeType

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

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

◆ self_type

using self_type = IteratorPreorder< is_const >

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

◆ SubtreeType

using SubtreeType = typename std::conditional< is_const, Subtree const, Subtree >::type

Definition at line 75 of file tree/iterator/preorder.hpp.

◆ TreeType

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

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


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