|
A library for working with phylogenetic and population genetic data.
v0.27.0
|
|
Go to the documentation of this file. 1 #ifndef GENESIS_TREE_ATTRIBUTE_TREE_TREE_H_
2 #define GENESIS_TREE_ATTRIBUTE_TREE_TREE_H_
116 static std::unique_ptr< AttributeTreeNodeData >
create()
121 virtual std::unique_ptr< BaseNodeData >
recreate()
const override
126 virtual std::unique_ptr< BaseNodeData >
clone()
const override
175 static std::unique_ptr< AttributeTreeEdgeData >
create()
180 virtual std::unique_ptr< BaseEdgeData >
recreate()
const override
185 virtual std::unique_ptr< BaseEdgeData >
clone()
const override
217 auto const& orig_node =
dynamic_cast< CommonNodeData const&
>( node_data );
218 attr_node->
name = orig_node.name;
224 auto const& orig_edge =
dynamic_cast< CommonEdgeData const&
>( edge_data );
235 #endif // include guard
Tree convert(Tree const &source, std::function< std::unique_ptr< BaseNodeData >(BaseNodeData const &node_data)> node_data_converter, std::function< std::unique_ptr< BaseEdgeData >(BaseEdgeData const &edge_data)> edge_data_converter)
Create a tree with the same topology as the source tree, while converting its data.
std::map< std::string, std::string > AttributeTreeMap
Alias for the map type used by an AttributeTree.
AttributeTreeNodeData()=default
AttributeTreeEdgeData & operator=(AttributeTreeEdgeData &&)=delete
AttributeTreeNodeData & operator=(AttributeTreeNodeData &&)=delete
Base class for storing data on Edges of a Tree.
virtual ~AttributeTreeEdgeData() override=default
virtual std::unique_ptr< BaseNodeData > clone() const override
Polymorphically copy an instance of this class. Use instead of copy constructor.
Data class for AttributeTreeEdges.
virtual std::unique_ptr< BaseEdgeData > clone() const override
Polymorphically copy an instance of this class. Use instead of copy constructor.
Class for representing phylogenetic trees.
AttributeTreeMap attributes
List of attributes stored on this node.
virtual std::unique_ptr< BaseNodeData > recreate() const override
Polymorphically create a default-constructed instance of this class with the same derived type as it ...
double branch_length
Branch length of the edge.
AttributeTreeEdgeData()=default
AttributeTreeMap attributes
List of attributes stored on this edge.
std::string name
Name of the node.
static std::unique_ptr< AttributeTreeEdgeData > create()
Container namespace for all symbols of genesis in order to keep them separate when used as a library.
Base class for storing data on Nodes of a Tree.
virtual ~AttributeTreeNodeData() override=default
AttributeTree convert_common_tree_to_attribute_tree(CommonTree const &source)
Helper function that takes a CommonTree (or any Tree with Node and Edge data derived from it) and tur...
Common class containing the commonly needed data for tree edges.
Common class containing the commonly needed data for tree nodes.
Data class for AttributeTreeNodes.
virtual std::unique_ptr< BaseEdgeData > recreate() const override
Polymorphically create a default-constructed instance of this class with the same derived type as it ...
static std::unique_ptr< AttributeTreeNodeData > create()