A library for working with phylogenetic and population genetic data.
v0.27.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 59 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

typedef std::vector< Sequence >::const_iterator const_iterator
 
typedef Sequence const & const_reference
 
typedef std::vector< Sequence >::iterator iterator
 
typedef Sequencereference
 

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]

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

Definition at line 92 of file sequence_set.cpp.

◆ add() [2/2]

SequenceSet::reference add ( Sequence const &  s)

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

Definition at line 86 of file sequence_set.cpp.

◆ at() [1/2]

SequenceSet::reference at ( size_t  index)

Definition at line 62 of file sequence_set.cpp.

◆ at() [2/2]

SequenceSet::const_reference at ( size_t  index) const

Definition at line 67 of file sequence_set.cpp.

◆ begin() [1/2]

Definition at line 139 of file sequence_set.cpp.

◆ begin() [2/2]

const_iterator begin ( ) const

◆ cbegin()

SequenceSet::const_iterator cbegin ( ) const

Definition at line 159 of file sequence_set.cpp.

◆ cend()

Definition at line 164 of file sequence_set.cpp.

◆ clear()

void clear ( )

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

Definition at line 130 of file sequence_set.cpp.

◆ empty()

bool empty ( ) const

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

Definition at line 57 of file sequence_set.cpp.

◆ end() [1/2]

Definition at line 144 of file sequence_set.cpp.

◆ end() [2/2]

const_iterator end ( ) const

◆ operator=() [1/2]

SequenceSet& operator= ( SequenceSet &&  )
default

◆ operator=() [2/2]

SequenceSet& operator= ( SequenceSet const &  )
default

◆ operator[]() [1/2]

SequenceSet::reference operator[] ( size_t  index)

Definition at line 72 of file sequence_set.cpp.

◆ operator[]() [2/2]

SequenceSet::const_reference operator[] ( size_t  index) const

Definition at line 77 of file sequence_set.cpp.

◆ remove() [1/4]

void remove ( iterator  first,
iterator  last 
)

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

Definition at line 125 of file sequence_set.cpp.

◆ remove() [2/4]

void remove ( iterator  position)

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

Definition at line 119 of file sequence_set.cpp.

◆ remove() [3/4]

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.

Definition at line 107 of file sequence_set.cpp.

◆ remove() [4/4]

void remove ( size_t  index)

Remove the Sequence at a given index from the SequenceSet.

Definition at line 98 of file sequence_set.cpp.

◆ size()

size_t size ( ) const

Return the number of Sequences in the SequenceSet.

Definition at line 52 of file sequence_set.cpp.

Friends And Related Function Documentation

◆ swap

void swap ( SequenceSet lhs,
SequenceSet rhs 
)
friend

Definition at line 42 of file sequence_set.cpp.

Member Typedef Documentation

◆ const_iterator

typedef std::vector<Sequence>::const_iterator const_iterator

Definition at line 68 of file sequence_set.hpp.

◆ const_reference

typedef Sequence const& const_reference

Definition at line 71 of file sequence_set.hpp.

◆ iterator

typedef std::vector<Sequence>::iterator iterator

Definition at line 67 of file sequence_set.hpp.

◆ reference

typedef Sequence& reference

Definition at line 70 of file sequence_set.hpp.


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