A toolkit for working with phylogenetic data.
v0.19.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
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 const &)=default
 
 SequenceSet (SequenceSet &&)=default
 
 ~SequenceSet ()=default
 
reference add (Sequence const &s)
 Add a Sequence to the SequenceSet by copying it, and return a reference to it. More...
 
reference add (Sequence &&s)
 Add a Sequence to the SequenceSet by moving 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 const &)=default
 
SequenceSetoperator= (SequenceSet &&)=default
 
reference operator[] (size_t index)
 
const_reference operator[] (size_t index) const
 
void remove (size_t index)
 Remove the Sequence at a given index 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 (iterator position)
 Remove the Sequence at a given iterator position from the SequenceSet. More...
 
void remove (iterator first, iterator last)
 Remove the Sequences between the first (inclusive) and the last (exclusive) iterator position 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 ( )
default
~SequenceSet ( )
default
SequenceSet ( SequenceSet const &  )
default
SequenceSet ( SequenceSet &&  )
default

Member Function Documentation

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.

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

Definition at line 92 of file sequence_set.cpp.

SequenceSet::reference at ( size_t  index)

Definition at line 62 of file sequence_set.cpp.

SequenceSet::const_reference at ( size_t  index) const

Definition at line 67 of file sequence_set.cpp.

Definition at line 139 of file sequence_set.cpp.

SequenceSet::const_iterator begin ( ) const

Definition at line 149 of file sequence_set.cpp.

SequenceSet::const_iterator cbegin ( ) const

Definition at line 159 of file sequence_set.cpp.

Definition at line 164 of file sequence_set.cpp.

void clear ( )

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

Definition at line 130 of file sequence_set.cpp.

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.

Definition at line 144 of file sequence_set.cpp.

Definition at line 154 of file sequence_set.cpp.

SequenceSet& operator= ( SequenceSet const &  )
default
SequenceSet& operator= ( SequenceSet &&  )
default
SequenceSet::reference operator[] ( size_t  index)

Definition at line 72 of file sequence_set.cpp.

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

Definition at line 77 of file sequence_set.cpp.

void remove ( size_t  index)

Remove the Sequence at a given index from the SequenceSet.

Definition at line 98 of file sequence_set.cpp.

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.

void remove ( iterator  position)

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

Definition at line 119 of file sequence_set.cpp.

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.

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

void swap ( SequenceSet lhs,
SequenceSet rhs 
)
friend

Definition at line 42 of file sequence_set.cpp.

Member Typedef Documentation

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

Definition at line 68 of file sequence_set.hpp.

typedef Sequence const& const_reference

Definition at line 71 of file sequence_set.hpp.

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

Definition at line 67 of file sequence_set.hpp.

typedef Sequence& reference

Definition at line 70 of file sequence_set.hpp.


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