#include <genesis/sequence/sequence_set.hpp>
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 |
SequenceSet & | operator= (SequenceSet &&)=default |
SequenceSet & | operator= (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 Sequence & | reference |
Friends | |
void | swap (SequenceSet &lhs, SequenceSet &rhs) |
|
default |
|
default |
|
default |
|
default |
SequenceSet::reference add | ( | Sequence && | s | ) |
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 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.
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.
SequenceSet::const_iterator begin | ( | ) |
Definition at line 139 of file sequence_set.cpp.
const_iterator begin | ( | ) | const |
SequenceSet::const_iterator cbegin | ( | ) | const |
Definition at line 159 of file sequence_set.cpp.
SequenceSet::const_iterator cend | ( | ) | const |
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.
SequenceSet::const_iterator end | ( | ) |
Definition at line 144 of file sequence_set.cpp.
const_iterator end | ( | ) | const |
|
default |
|
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.
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.
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 | ( | 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 | ( | size_t | index | ) |
Remove the Sequence at a given index
from the SequenceSet.
Definition at line 98 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.
|
friend |
Definition at line 42 of file sequence_set.cpp.
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.
Definition at line 67 of file sequence_set.hpp.
Definition at line 70 of file sequence_set.hpp.