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

#include <genesis/placement/sample_set.hpp>

Detailed Description

Store a set of Samples with associated names.

The elements in this set are stored as a NamedSample. They are stored in the sequence in which they are added to the set, and can be accessed via an index.

Definition at line 52 of file sample_set.hpp.

Public Member Functions

 SampleSet ()=default
 
 SampleSet (SampleSet const &)=default
 
 SampleSet (SampleSet &&)=default
 
 ~SampleSet ()=default
 
void add (Sample const &smp)
 Add a Sample to the SampleSet. More...
 
void add (Sample const &smp, std::string const &name)
 Add a Sample with a name to the SampleSet. More...
 
void add (Sample &&smp)
 Add a Sample to the SampleSet. More...
 
void add (Sample &&smp, std::string const &name)
 Add a Sample with a name to the SampleSet. More...
 
NamedSampleat (size_t index)
 Get the NamedSample at a certain index position. More...
 
NamedSample const & at (size_t index) const
 Get the NamedSample at a certain index position. More...
 
iterator begin ()
 
const_iterator begin () const
 
void clear ()
 Delete all Samples in this SampleSet. More...
 
bool empty () const
 Return whether the SampleSet is empty. More...
 
iterator end ()
 
const_iterator end () const
 
SampleSetoperator= (SampleSet const &)=default
 
SampleSetoperator= (SampleSet &&)=default
 
NamedSampleoperator[] (size_t index)
 Get the NamedSample at a certain index position. More...
 
NamedSample const & operator[] (size_t index) const
 Get the NamedSample at a certain index position. More...
 
void remove_at (size_t index)
 Remove the Sample at a certain index position. More...
 
size_t size () const
 Return the size of the SampleSet, i.e., the number of Samples. More...
 
void swap (SampleSet &other)
 

Public Types

typedef std::vector
< NamedSample >
::const_iterator 
const_iterator
 
typedef std::vector
< NamedSample >::iterator 
iterator
 

Classes

struct  NamedSample
 Store a Sample and a name for it. More...
 

Constructor & Destructor Documentation

SampleSet ( )
default
~SampleSet ( )
default
SampleSet ( SampleSet const &  )
default
SampleSet ( SampleSet &&  )
default

Member Function Documentation

void add ( Sample const &  smp)
inline

Add a Sample to the SampleSet.

The Sample is copied. The name is set to empty string.

Definition at line 113 of file sample_set.hpp.

void add ( Sample const &  smp,
std::string const &  name 
)
inline

Add a Sample with a name to the SampleSet.

The Sample is copied.

Definition at line 123 of file sample_set.hpp.

void add ( Sample &&  smp)
inline

Add a Sample to the SampleSet.

The Sample is moved. The name is set to empty string.

Definition at line 133 of file sample_set.hpp.

void add ( Sample &&  smp,
std::string const &  name 
)
inline

Add a Sample with a name to the SampleSet.

The Sample is moved.

Definition at line 143 of file sample_set.hpp.

NamedSample& at ( size_t  index)
inline

Get the NamedSample at a certain index position.

Definition at line 194 of file sample_set.hpp.

NamedSample const& at ( size_t  index) const
inline

Get the NamedSample at a certain index position.

Definition at line 202 of file sample_set.hpp.

iterator begin ( )
inline

Definition at line 171 of file sample_set.hpp.

const_iterator begin ( ) const
inline

Definition at line 176 of file sample_set.hpp.

void clear ( )
inline

Delete all Samples in this SampleSet.

Definition at line 162 of file sample_set.hpp.

bool empty ( ) const
inline

Return whether the SampleSet is empty.

Definition at line 226 of file sample_set.hpp.

iterator end ( )
inline

Definition at line 181 of file sample_set.hpp.

const_iterator end ( ) const
inline

Definition at line 186 of file sample_set.hpp.

SampleSet& operator= ( SampleSet const &  )
default
SampleSet& operator= ( SampleSet &&  )
default
NamedSample& operator[] ( size_t  index)
inline

Get the NamedSample at a certain index position.

Definition at line 210 of file sample_set.hpp.

NamedSample const& operator[] ( size_t  index) const
inline

Get the NamedSample at a certain index position.

Definition at line 218 of file sample_set.hpp.

void remove_at ( size_t  index)
inline

Remove the Sample at a certain index position.

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

Definition at line 154 of file sample_set.hpp.

size_t size ( ) const
inline

Return the size of the SampleSet, i.e., the number of Samples.

Definition at line 234 of file sample_set.hpp.

void swap ( SampleSet other)
inline

Definition at line 98 of file sample_set.hpp.

Member Typedef Documentation

typedef std::vector<NamedSample>::const_iterator const_iterator

Definition at line 83 of file sample_set.hpp.

typedef std::vector<NamedSample>::iterator iterator

Definition at line 82 of file sample_set.hpp.


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