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 virtual std::unique_ptr< BaseNodeData > recreate() const override
Polymorphically create a default-constructed instance of this class with the same derived type as it ...
Data class for AttributeTreeNodes.
Data class for AttributeTreeEdges.
static std::unique_ptr< AttributeTreeEdgeData > create()
virtual ~AttributeTreeNodeData() override=default
Base class for storing data on Nodes of a Tree.
virtual std::unique_ptr< BaseNodeData > clone() const override
Polymorphically copy an instance of this class. Use instead of copy constructor.
static std::unique_ptr< AttributeTreeNodeData > create()
virtual std::unique_ptr< BaseEdgeData > clone() const override
Polymorphically copy an instance of this class. Use instead of copy constructor.
Container namespace for all symbols of genesis in order to keep them separate when used as a library...
AttributeTreeNodeData & operator=(AttributeTreeNodeData &&)=delete
Class for representing phylogenetic trees.
AttributeTreeMap attributes
List of attributes stored on this node.
std::string name
Name of the node.
double branch_length
Branch length of the edge.
AttributeTreeMap attributes
List of attributes stored on this edge.
Common class containing the commonly needed data for tree nodes.
AttributeTreeNodeData()=default
std::map< std::string, std::string > AttributeTreeMap
Alias for the map type used by an AttributeTree.
Base class for storing data on Edges of a Tree.
Common class containing the commonly needed data for tree edges.
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.
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...
virtual std::unique_ptr< BaseEdgeData > recreate() const override
Polymorphically create a default-constructed instance of this class with the same derived type as it ...