A library for working with phylogenetic and population genetic data.
v0.32.0
CommonEdgeData Class Reference

#include <genesis/tree/common_tree/tree.hpp>

Inherits BaseEdgeData.

Inherited by PlacementEdgeData, AttributeTreeEdgeData, LayoutEdgeData, MassTreeEdgeData, and SimpleNewickEdgeData.

Detailed Description

Common class containing the commonly needed data for tree edges.

This class is the equivalent of CommonNodeData for the tree edges. It stores a branch length for each edge. For more information, see CommonNodeData.

If you for example do not need a single branch length, but multiple ones (e.g., when working with partitions), simply do not derive from this class, but provide your own implementation.

Definition at line 144 of file tree/common_tree/tree.hpp.

Public Member Functions

 CommonEdgeData (CommonEdgeData &&)=delete
 
virtual ~CommonEdgeData () override=default
 
virtual std::unique_ptr< BaseEdgeDataclone () const override
 Polymorphically copy an instance of this class. Use instead of copy constructor. More...
 
CommonEdgeDataoperator= (CommonEdgeData &&)=delete
 
virtual std::unique_ptr< BaseEdgeDatarecreate () const override
 Polymorphically create a default-constructed instance of this class with the same derived type as it was called on. More...
 
- Public Member Functions inherited from BaseEdgeData
 BaseEdgeData (BaseEdgeData &&)=delete
 Deleted move constructor. More...
 
virtual ~BaseEdgeData ()=default
 Virtual destructor. Needed for polymorphism. More...
 
BaseEdgeDataoperator= (BaseEdgeData &&)=delete
 Deleted move assignment. More...
 

Static Public Member Functions

static std::unique_ptr< CommonEdgeDatacreate ()
 
- Static Public Member Functions inherited from BaseEdgeData
static std::unique_ptr< BaseEdgeDatacreate ()
 Create a new instance of this class. Use instead of default constructor. More...
 

Public Attributes

double branch_length = 0.0
 Branch length of the edge. More...
 

Protected Member Functions

 CommonEdgeData ()=default
 
 CommonEdgeData (CommonEdgeData const &)=default
 
CommonEdgeDataoperator= (CommonEdgeData const &)=default
 
- Protected Member Functions inherited from BaseEdgeData
 BaseEdgeData ()=default
 Protected default constructor. Called from the create() function. More...
 
 BaseEdgeData (BaseEdgeData const &)=default
 Protected copy constructor. Called from the clone() function. More...
 
BaseEdgeDataoperator= (BaseEdgeData const &)=default
 Protected copy assignment. Not used right now. More...
 

Constructor & Destructor Documentation

◆ ~CommonEdgeData()

virtual ~CommonEdgeData ( )
overridevirtualdefault

◆ CommonEdgeData() [1/3]

CommonEdgeData ( CommonEdgeData &&  )
delete

◆ CommonEdgeData() [2/3]

CommonEdgeData ( )
protecteddefault

◆ CommonEdgeData() [3/3]

CommonEdgeData ( CommonEdgeData const &  )
protecteddefault

Member Function Documentation

◆ clone()

virtual std::unique_ptr< BaseEdgeData > clone ( ) const
inlineoverridevirtual

Polymorphically copy an instance of this class. Use instead of copy constructor.

Reimplemented from BaseEdgeData.

Reimplemented in LayoutEdgeData, SimpleNewickEdgeData, AttributeTreeEdgeData, PlacementEdgeData, and MassTreeEdgeData.

Definition at line 178 of file tree/common_tree/tree.hpp.

◆ create()

static std::unique_ptr< CommonEdgeData > create ( )
inlinestatic

Definition at line 168 of file tree/common_tree/tree.hpp.

◆ operator=() [1/2]

CommonEdgeData& operator= ( CommonEdgeData &&  )
delete

◆ operator=() [2/2]

CommonEdgeData& operator= ( CommonEdgeData const &  )
protecteddefault

◆ recreate()

virtual std::unique_ptr< BaseEdgeData > recreate ( ) const
inlineoverridevirtual

Polymorphically create a default-constructed instance of this class with the same derived type as it was called on.

Reimplemented from BaseEdgeData.

Reimplemented in LayoutEdgeData, SimpleNewickEdgeData, AttributeTreeEdgeData, PlacementEdgeData, and MassTreeEdgeData.

Definition at line 173 of file tree/common_tree/tree.hpp.

Member Data Documentation

◆ branch_length

double branch_length = 0.0

Branch length of the edge.

Initialized to 0.0. This allows to add default-created edges to the Tree without changing any metrics related to the branch length.

Definition at line 193 of file tree/common_tree/tree.hpp.


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