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_ );
114 swap( static_cast< Taxonomy& >( lhs ), static_cast< Taxonomy& >( rhs ) );
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 const * parent() const
Return a pointer to the parent of this taxon, or a nullptr if this is the top level taxon...
Taxon()
Default constructor. Does nothing. Yields an empty Taxon.
Taxonomy & operator=(Taxonomy const &)
Copy assigment operator.
virtual Taxon & add_child_(Taxon const &child, bool merge_duplicates)
Virtual implementation function for adding a child Taxon.
Taxon & operator=(Taxon const &)
Copy assignment operator.
Container namespace for all symbols of genesis in order to keep them separate when used as a library...
std::string const & rank() const
Return the rank of this taxon.
Taxon & add_child_(Taxon const &child, bool merge_duplicates) override
Virtual implementation function for adding a child taxon.
void reset_parent_pointers_(Taxon *parent)
Internal helper function that resets the parent pointer of all stored Taxa.
Store a Taxonomy, i.e., a nested hierarchy of Taxa.
std::string const & name() const
Return the name of this taxon.
Store a Taxon, i.e., an element in a Taxonomy, with its name, rank, ID and sub-taxa.
void swap(Taxon &lhs, Taxon &rhs)
Taxon & reset_data(std::unique_ptr< BaseTaxonData > data)
Reset the data pointer of this Taxon.
std::string const & id() const
Set the ID of this taxon.
BaseTaxonData * data_ptr()
Return a pointer to the data.
Base class for storing data on Taxa of a Taxonomy.
friend void swap(Taxon &lhs, Taxon &rhs)
Swapperator for Taxon.
void merge_duplicates(Sample &smp)
Look for Pqueries with the same name and merge them.
bool has_data() const
Return true if the Taxon has a data object assigned to it.