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

#include <genesis/tree/tree_set.hpp>

Detailed Description

Definition at line 47 of file tree_set.hpp.

Public Member Functions

 TreeSet ()=default
 
 TreeSet (TreeSet const &)=default
 
 TreeSet (TreeSet &&)=default
 
 ~TreeSet ()=default
 
void add (std::string const &name, Tree const &tree)
 Add a Tree with a name to the TreeSet. More...
 
void add (std::string &&name, Tree &&tree)
 
NamedTreeat (size_t index)
 
const NamedTreeat (size_t index) const
 
iterator begin ()
 
const_iterator begin () const
 
void clear ()
 Clear the TreeSet and destroy all contained Trees. More...
 
bool empty () const
 Return whether the TreeSet is empty. More...
 
iterator end ()
 
const_iterator end () const
 
TreeSetoperator= (TreeSet const &)=default
 
TreeSetoperator= (TreeSet &&)=default
 
NamedTreeoperator[] (const std::size_t index)
 
const NamedTreeoperator[] (const std::size_t index) const
 
void remove_at (size_t index)
 Remove the Tree at a certain index position. More...
 
size_t size () const
 Return the size of the TreeSet, i.e., the number of stored Trees. More...
 
void swap (TreeSet &other)
 

Public Types

using const_iterator = typename std::vector< NamedTree >::const_iterator
 
using iterator = typename std::vector< NamedTree >::iterator
 

Classes

struct  NamedTree
 Store a Tree together with a name for it. More...
 

Constructor & Destructor Documentation

TreeSet ( )
default
~TreeSet ( )
default
TreeSet ( TreeSet const &  )
default
TreeSet ( TreeSet &&  )
default

Member Function Documentation

void add ( std::string const &  name,
Tree const &  tree 
)

Add a Tree with a name to the TreeSet.

The Tree is copied.

Definition at line 55 of file tree_set.cpp.

void add ( std::string &&  name,
Tree &&  tree 
)

Definition at line 60 of file tree_set.cpp.

TreeSet::NamedTree & at ( size_t  index)

Definition at line 108 of file tree_set.cpp.

TreeSet::NamedTree const & at ( size_t  index) const

Definition at line 113 of file tree_set.cpp.

TreeSet::iterator begin ( )

Definition at line 88 of file tree_set.cpp.

TreeSet::const_iterator begin ( ) const

Definition at line 93 of file tree_set.cpp.

void clear ( )

Clear the TreeSet and destroy all contained Trees.

Definition at line 79 of file tree_set.cpp.

bool empty ( ) const

Return whether the TreeSet is empty.

Definition at line 131 of file tree_set.cpp.

Definition at line 98 of file tree_set.cpp.

TreeSet::const_iterator end ( ) const

Definition at line 103 of file tree_set.cpp.

TreeSet& operator= ( TreeSet const &  )
default
TreeSet& operator= ( TreeSet &&  )
default
TreeSet::NamedTree & operator[] ( const std::size_t  index)

Definition at line 118 of file tree_set.cpp.

TreeSet::NamedTree const & operator[] ( const std::size_t  index) const

Definition at line 123 of file tree_set.cpp.

void remove_at ( size_t  index)

Remove the Tree at a certain index position.

As this function moves Trees in the container around, all iterators and pointers to the elements of this TreeSet are considered to be invalidated.

Definition at line 71 of file tree_set.cpp.

size_t size ( ) const

Return the size of the TreeSet, i.e., the number of stored Trees.

Definition at line 139 of file tree_set.cpp.

void swap ( TreeSet other)

Definition at line 40 of file tree_set.cpp.

Member Typedef Documentation

using const_iterator = typename std::vector<NamedTree>::const_iterator

Definition at line 65 of file tree_set.hpp.

using iterator = typename std::vector<NamedTree>::iterator

Definition at line 64 of file tree_set.hpp.


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