#include <genesis/placement/sample_set.hpp>
Store a set of Samples with associated names.
The elements in this set are stored in the sequence in which they are added to the set, and can be accessed via an index.
Definition at line 54 of file sample_set.hpp.
Public Member Functions | |
SampleSet ()=default | |
SampleSet (SampleSet &&)=default | |
SampleSet (SampleSet const &)=default | |
~SampleSet ()=default | |
void | add (Sample &&smp, std::string const &name="") |
Add a Sample with a name to the SampleSet. More... | |
void | add (Sample const &smp, std::string const &name="") |
Add a Sample with a name to the SampleSet. More... | |
Sample & | at (size_t index) |
Sample const & | at (size_t index) const |
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 |
std::string const & | name_at (size_t index) const |
std::vector< std::string > const & | names () const |
operator std::vector< Sample > const & () const | |
Implicit conversion, so that a SampleSet can be used in functions that expect a std::vector instead. More... | |
SampleSet & | operator= (SampleSet &&)=default |
SampleSet & | operator= (SampleSet const &)=default |
Sample & | operator[] (size_t index) |
Sample const & | operator[] (size_t index) const |
void | remove_at (size_t index) |
Remove the Sample at a certain index position. More... | |
std::vector< Sample > const & | samples () const |
size_t | size () const |
Return the size of the SampleSet, i.e., the number of Samples. More... | |
void | swap (SampleSet &other) |
Public Types | |
using | const_iterator = typename std::vector< Sample >::const_iterator |
using | iterator = typename std::vector< Sample >::iterator |
|
default |
|
default |
|
inline |
Add a Sample with a name to the SampleSet.
The Sample is moved.
Definition at line 105 of file sample_set.hpp.
|
inline |
Add a Sample with a name to the SampleSet.
The Sample is copied.
Definition at line 94 of file sample_set.hpp.
|
inline |
Definition at line 184 of file sample_set.hpp.
|
inline |
Definition at line 189 of file sample_set.hpp.
|
inline |
Definition at line 164 of file sample_set.hpp.
|
inline |
Definition at line 169 of file sample_set.hpp.
|
inline |
Delete all Samples in this SampleSet.
Definition at line 134 of file sample_set.hpp.
|
inline |
Return whether the SampleSet is empty.
Definition at line 225 of file sample_set.hpp.
|
inline |
Definition at line 174 of file sample_set.hpp.
|
inline |
Definition at line 179 of file sample_set.hpp.
|
inline |
Definition at line 144 of file sample_set.hpp.
|
inline |
Definition at line 155 of file sample_set.hpp.
|
inline |
Implicit conversion, so that a SampleSet can be used in functions that expect a std::vector
instead.
Definition at line 213 of file sample_set.hpp.
|
inline |
Definition at line 194 of file sample_set.hpp.
|
inline |
Definition at line 199 of file sample_set.hpp.
|
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 117 of file sample_set.hpp.
|
inline |
Definition at line 204 of file sample_set.hpp.
|
inline |
Return the size of the SampleSet, i.e., the number of Samples.
Definition at line 234 of file sample_set.hpp.
|
inline |
Definition at line 78 of file sample_set.hpp.
using const_iterator = typename std::vector<Sample>::const_iterator |
Definition at line 63 of file sample_set.hpp.
Definition at line 62 of file sample_set.hpp.