Quetzal-CoaTL
The Coalescence Template Library
Loading...
Searching...
No Matches
quetzal::format::newick::Formatter< T, P1, P2, F1, F2, Policy > Class Template Reference

#include <quetzal/io/newick/extended/from_network.hpp>

Detailed Description

template<class T, std::predicate< T > P1, std::predicate< T > P2, Formattable< T > F1, Formattable< T > F2, class Policy = PAUP>
class quetzal::format::newick::Formatter< T, P1, P2, F1, F2, Policy >

Generic algorithm to generate the Newick formula of a tree.

Public Types

using node_type = T
 Type of node being formatted.
 
using formula_type = std::string
 Type of formula being generated.
 
using policy_type = Policy
 Type of formula being generated.
 

Public Member Functions

 Formatter (P1 &&has_parent, P2 &&has_children, F1 &&label, F2 &&branch_length)
 Constructor.
 
auto pre_order ()
 Operation called in the general DFS algorithm to open a parenthesis if node has children to be visited.
 
auto in_order ()
 Operation called in the general DFS algorithm to add a comma between visited nodes.
 
auto post_order ()
 Operation to be passed to a generic DFS algorithm to open a parenthesis if node has children to be visited.
 
void clear ()
 Clear the formula buffer.
 
formula_type get () const
 Retrieve the formatted string of the given node in the specified format.
 

Static Public Member Functions

static std::string root_branch_length ()
 
static std::string root_branch_length ()
 
static std::string treat_comments (std::string &s)
 
static std::string treat_comments (std::string &s)
 

Member Function Documentation

◆ post_order()

template<class T , std::predicate< T > P1, std::predicate< T > P2, Formattable< T > F1, Formattable< T > F2, class Policy = PAUP>
auto quetzal::format::newick::Formatter< T, P1, P2, F1, F2, Policy >::post_order ( )
inline

Operation to be passed to a generic DFS algorithm to open a parenthesis if node has children to be visited.

Parameters
nodethe node currently visited

◆ pre_order()

template<class T , std::predicate< T > P1, std::predicate< T > P2, Formattable< T > F1, Formattable< T > F2, class Policy = PAUP>
auto quetzal::format::newick::Formatter< T, P1, P2, F1, F2, Policy >::pre_order ( )
inline

Operation called in the general DFS algorithm to open a parenthesis if node has children to be visited.

Parameters
nodethe node currently visited

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