A toolkit for working with phylogenetic data.
v0.19.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
BaseTaxonData Class Reference

#include <genesis/taxonomy/taxon_data.hpp>

Inherited by EntropyTaxonData.

Detailed Description

Base class for storing data on Taxa of a Taxonomy.

This class provides the start point for the class hierarchy of taxon data classes. In order to correctly achieve polymorphic behaviour, and with its use case in a Taxonomy in mind, this class and its derived classes are only usable via unique pointers to their instances.

It thus provides a create() function instead of a default constructor. Stack copies of this class are useless; we always want a pointer to the class. For the same reason, instead of a copy constructor, it provides a clone() function.

It is recommended that derived classes follow the same access rules for its constructors.

Definition at line 56 of file taxon_data.hpp.

Public Member Functions

 BaseTaxonData (BaseTaxonData &&)=delete
 Deleted move constructor. More...
 
virtual ~BaseTaxonData ()=default
 Virtual destructor. Needed for polymorphism. More...
 
virtual std::unique_ptr
< BaseTaxonData
clone () const
 Polymorphically copy an instance of this class. Use instead of copy constructor. More...
 
BaseTaxonDataoperator= (BaseTaxonData &&)=delete
 Deleted move assignment. More...
 

Static Public Member Functions

static std::unique_ptr
< BaseTaxonData
create ()
 Create a new instance of this class. Use instead of default constructor. More...
 

Protected Member Functions

 BaseTaxonData ()=default
 Protected default constructor. Called from the create() function. More...
 
 BaseTaxonData (BaseTaxonData const &)=default
 Protected copy constructor. Called from the clone() function. More...
 
BaseTaxonDataoperator= (BaseTaxonData const &)=default
 Protected copy assignment. Not used right now. More...
 

Constructor & Destructor Documentation

virtual ~BaseTaxonData ( )
virtualdefault

Virtual destructor. Needed for polymorphism.

BaseTaxonData ( BaseTaxonData &&  )
delete

Deleted move constructor.

Not viable with polymorphism. Also, we don't need it. The data is held by pointer (in order to allow polymorphism in the first place), so we can simply move the pointer instead.

BaseTaxonData ( )
protecteddefault

Protected default constructor. Called from the create() function.

BaseTaxonData ( BaseTaxonData const &  )
protecteddefault

Protected copy constructor. Called from the clone() function.

Member Function Documentation

virtual std::unique_ptr< BaseTaxonData > clone ( ) const
inlinevirtual

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

Reimplemented in EntropyTaxonData.

Definition at line 115 of file taxon_data.hpp.

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

Create a new instance of this class. Use instead of default constructor.

Definition at line 107 of file taxon_data.hpp.

BaseTaxonData& operator= ( BaseTaxonData &&  )
delete

Deleted move assignment.

Not viable with polymorphism. Also, we don't need it. The data is held by pointer (in order to allow polymorphism in the first place), so we can simply move the pointer instead.

BaseTaxonData& operator= ( BaseTaxonData const &  )
protecteddefault

Protected copy assignment. Not used right now.


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