|
A library for working with phylogenetic and population genetic data.
v0.32.0
|
|
Go to the documentation of this file.
52 Taxon::Taxon( std::string
const& name, std::string
const& rank, std::string
const&
id )
63 , name_( other.name_ )
64 , rank_( other.rank_ )
76 , name_( std::move( other.name_ ))
77 , rank_( std::move( other.rank_ ))
78 , id_( std::move( other.id_ ))
79 , parent_( other.parent_ )
80 , data_( std::move( other.data_ ))
102 name_ = std::move( other.name_ );
103 rank_ = std::move( other.rank_ );
104 id_ = std::move( other.id_ );
105 parent_ = other.parent_;
106 data_ = std::move( other.data_ );
116 swap( lhs.name_, rhs.name_ );
117 swap( lhs.rank_, rhs.rank_ );
118 swap( lhs.id_, rhs.id_ );
119 swap( lhs.parent_, rhs.parent_ );
120 swap( lhs.data_, rhs.data_ );
189 return data_.get() !=
nullptr;
204 data_ = std::move(
data );
Taxon & operator=(Taxon const &)
Copy assignment operator.
Taxon const * parent() const
Return a pointer to the parent of this taxon, or a nullptr if this is the top level taxon.
Base class for storing data on Taxa of a Taxonomy.
Taxon & add_child_(Taxon const &child, bool merge_duplicates) override
Virtual implementation function for adding a child taxon.
Taxon()
Default constructor. Does nothing. Yields an empty Taxon.
Taxonomy & operator=(Taxonomy const &)
Copy assignment operator.
Store a Taxon, i.e., an element in a Taxonomy, with its name, rank, ID and sub-taxa.
void reset_parent_pointers_(Taxon *parent)
Internal helper function that resets the parent pointer of all stored Taxa.
std::string const & rank() const
Return the rank of this taxon.
void swap(Taxon &lhs, Taxon &rhs)
std::string const & name() const
Return the name of this taxon.
BaseTaxonData * data_ptr()
Return a pointer to the data.
Container namespace for all symbols of genesis in order to keep them separate when used as a library.
Store a Taxonomy, i.e., a nested hierarchy of Taxa.
void merge_duplicates(Sample &smp)
Look for Pqueries with the same name and merge them.
virtual Taxon & add_child_(Taxon const &child, bool merge_duplicates)
Virtual implementation function for adding a child Taxon.
Taxon & reset_data(std::unique_ptr< BaseTaxonData > data)
Reset the data pointer of this Taxon.
bool has_data() const
Return true if the Taxon has a data object assigned to it.
std::string const & id() const
Set the ID of this taxon.