A library for working with phylogenetic and population genetic data.
v0.32.0
SequenceSet Class Reference

#include <genesis/sequence/sequence_set.hpp>

Detailed Description

Store a set of Sequences.

A SequenceSet is a simple container that allows to add(), remove() and iterate over Sequences. Sequences are kept in the order in which they were added and can be accessed via an index, see at().

Definition at line 53 of file sequence_set.hpp.

Public Member Functions

 SequenceSet ()=default
 
 SequenceSet (SequenceSet &&)=default
 
 SequenceSet (SequenceSet const &)=default
 
 ~SequenceSet ()=default
 
reference add (Sequence &&s)
 Add a Sequence to the SequenceSet by moving it, and return a reference to it. More...
 
reference add (Sequence const &s)
 Add a Sequence to the SequenceSet by copying it, and return a reference to it. More...
 
reference at (size_t index)
 
const_reference at (size_t index) const
 
iterator begin ()
 
const_iterator begin () const
 
const_iterator cbegin () const
 
const_iterator cend () const
 
void clear ()
 Remove all Sequences from the SequenceSet, leaving it with a size() of 0. More...
 
bool empty () const
 
iterator end ()
 
const_iterator end () const
 
SequenceSetoperator= (SequenceSet &&)=default
 
SequenceSetoperator= (SequenceSet const &)=default
 
reference operator[] (size_t index)
 
const_reference operator[] (size_t index) const
 
void remove (iterator first, iterator last)
 Remove the Sequences between the first (inclusive) and the last (exclusive) iterator position from the SequenceSet. More...
 
void remove (iterator position)
 Remove the Sequence at a given iterator position from the SequenceSet. More...
 
void remove (size_t first_index, size_t last_index)
 Remove the Sequences between the first_index (inclusive) and the last_index (exclusive) from the SequenceSet. More...
 
void remove (size_t index)
 Remove the Sequence at a given index from the SequenceSet. More...
 
size_t size () const
 

Public Types

using const_iterator = std::vector< Sequence >::const_iterator
 
using const_reference = Sequence const &
 
using iterator = std::vector< Sequence >::iterator
 
using reference = Sequence &
 

Friends

void swap (SequenceSet &lhs, SequenceSet &rhs)
 

Constructor & Destructor Documentation

◆ SequenceSet() [1/3]

SequenceSet ( )
default

◆ ~SequenceSet()

~SequenceSet ( )
default

◆ SequenceSet() [2/3]

SequenceSet ( SequenceSet const &  )
default

◆ SequenceSet() [3/3]

SequenceSet ( SequenceSet &&  )
default

Member Function Documentation

◆ add() [1/2]

reference add ( Sequence &&  s)
inline

Add a Sequence to the SequenceSet by moving it, and return a reference to it.

Definition at line 142 of file sequence_set.hpp.

◆ add() [2/2]

reference add ( Sequence const &  s)
inline

Add a Sequence to the SequenceSet by copying it, and return a reference to it.

Definition at line 133 of file sequence_set.hpp.

◆ at() [1/2]

reference at ( size_t  index)
inline

Definition at line 106 of file sequence_set.hpp.

◆ at() [2/2]

const_reference at ( size_t  index) const
inline

Definition at line 111 of file sequence_set.hpp.

◆ begin() [1/2]

iterator begin ( )
inline

Definition at line 205 of file sequence_set.hpp.

◆ begin() [2/2]

const_iterator begin ( ) const
inline

Definition at line 215 of file sequence_set.hpp.

◆ cbegin()

const_iterator cbegin ( ) const
inline

Definition at line 225 of file sequence_set.hpp.

◆ cend()

const_iterator cend ( ) const
inline

Definition at line 230 of file sequence_set.hpp.

◆ clear()

void clear ( )
inline

Remove all Sequences from the SequenceSet, leaving it with a size() of 0.

Definition at line 196 of file sequence_set.hpp.

◆ empty()

bool empty ( ) const
inline

Return whether the SequenceSet is empty, i.e. whether its size() is 0.

Definition at line 101 of file sequence_set.hpp.

◆ end() [1/2]

iterator end ( )
inline

Definition at line 210 of file sequence_set.hpp.

◆ end() [2/2]

const_iterator end ( ) const
inline

Definition at line 220 of file sequence_set.hpp.

◆ operator=() [1/2]

SequenceSet& operator= ( SequenceSet &&  )
default

◆ operator=() [2/2]

SequenceSet& operator= ( SequenceSet const &  )
default

◆ operator[]() [1/2]

reference operator[] ( size_t  index)
inline

Definition at line 116 of file sequence_set.hpp.

◆ operator[]() [2/2]

const_reference operator[] ( size_t  index) const
inline

Definition at line 121 of file sequence_set.hpp.

◆ remove() [1/4]

void remove ( iterator  first,
iterator  last 
)
inline

Remove the Sequences between the first (inclusive) and the last (exclusive) iterator position from the SequenceSet.

Definition at line 188 of file sequence_set.hpp.

◆ remove() [2/4]

void remove ( iterator  position)
inline

Remove the Sequence at a given iterator position from the SequenceSet.

Definition at line 179 of file sequence_set.hpp.

◆ remove() [3/4]

void remove ( size_t  first_index,
size_t  last_index 
)
inline

Remove the Sequences between the first_index (inclusive) and the last_index (exclusive) from the SequenceSet.

Definition at line 164 of file sequence_set.hpp.

◆ remove() [4/4]

void remove ( size_t  index)
inline

Remove the Sequence at a given index from the SequenceSet.

Definition at line 151 of file sequence_set.hpp.

◆ size()

size_t size ( ) const
inline

Return the number of Sequences in the SequenceSet.

Definition at line 93 of file sequence_set.hpp.

Friends And Related Function Documentation

◆ swap

void swap ( SequenceSet lhs,
SequenceSet rhs 
)
friend

Definition at line 80 of file sequence_set.hpp.

Member Typedef Documentation

◆ const_iterator

using const_iterator = std::vector<Sequence>::const_iterator

Definition at line 62 of file sequence_set.hpp.

◆ const_reference

using const_reference = Sequence const&

Definition at line 65 of file sequence_set.hpp.

◆ iterator

using iterator = std::vector<Sequence>::iterator

Definition at line 61 of file sequence_set.hpp.

◆ reference

using reference = Sequence&

Definition at line 64 of file sequence_set.hpp.


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