A vector of peptide quant keys. More...
#include <ms_peptide_quant_key_vector.hpp>
Public Member Functions | |
ms_peptide_quant_key_vector () | |
Create an empty peptide quant key vector. | |
ms_peptide_quant_key_vector (const ms_peptide_quant_key_vector &src) | |
Copying constructor. | |
ms_peptide_quant_key_vector (const std::list< ms_peptide_quant_key > &v) | |
Create a peptide quant key vector from an STL list. | |
ms_peptide_quant_key_vector (const std::vector< ms_peptide_quant_key > &v) | |
Create a peptide quant key vector from an STL vector. | |
~ms_peptide_quant_key_vector () | |
Destructor. | |
void | append (const ms_peptide_quant_key_vector &src) |
Appends all content from another instance of the class. | |
void | clear () |
Clear the vector. | |
void | copyFrom (const ms_peptide_quant_key_vector *src) |
Copies all content from another instance of the class. | |
bool | empty () const |
Boolean test: is the vector empty? | |
ms_peptide_quant_key | get (int idx) const |
Return the peptide quant key at the given index. | |
ms_peptide_quant_key_vector & | operator= (const ms_peptide_quant_key_vector &right) |
C++ assignment operator. | |
ms_peptide_quant_key | pop () |
Pop a value from the end of the vector. | |
void | push (const ms_peptide_quant_key &key) |
Push a new peptide quant key at the end of the vector. | |
void | set (int idx, const ms_peptide_quant_key &key) |
Set the value at the given index. | |
int | size () const |
Return the size of the container. | |
void | swap (ms_peptide_quant_key_vector &right) |
Swap the contents with another peptide quant key vector. | |
const std::vector< ms_peptide_quant_key > & | toVector () const |
C++ conversion to std::vector. | |
A vector of peptide quant keys.
ms_peptide_quant_key_vector is a wrapper around the C++ vector class std::vector, specialised to contain ms_peptide_quant_key objects. The ms_quantitation and ms_protein_quant_ratio classes return such peptide quant key vectors.
The interface to this class follows that of vectori and vectorString, as described in Using STL vector classes vectori, vectord and VectorString in Perl, Java, Python and C#.
|
explicit |
Create a peptide quant key vector from an STL vector.
v | STL vector to initialise with. |
|
explicit |
Create a peptide quant key vector from an STL list.
v | STL list to initialise with. |
void append | ( | const ms_peptide_quant_key_vector & | src | ) |
Appends all content from another instance of the class.
src | is another ms_peptide_quant_key_vector to append the keys from. |
void clear | ( | ) |
Clear the vector.
After clear, the vector will be empty.
bool empty | ( | ) | const |
Boolean test: is the vector empty?
ms_peptide_quant_key get | ( | int | idx | ) | const |
Return the peptide quant key at the given index.
To use this function from R, call getKey(int idx) instead
Note that idx must be within the 0-indexed range. Otherwise the method will throw an exception.
idx | The element index, 0..size()-1. |
ms_peptide_quant_key pop | ( | ) |
Pop a value from the end of the vector.
Note that the vector must be nonempty (it must contain at least one element). If it doesn't, the method throws an exception.
void push | ( | const ms_peptide_quant_key & | key | ) |
Push a new peptide quant key at the end of the vector.
key | Key to append to the vector. |
void set | ( | int | idx, |
const ms_peptide_quant_key & | key | ||
) |
int size | ( | ) | const |
Return the size of the container.
void swap | ( | ms_peptide_quant_key_vector & | src | ) |
Swap the contents with another peptide quant key vector.
After this method returns, the data of src is stored inside this object, and src stores the old contents of this object.
src | Peptide quant key vector to swap contents with. |
const std::vector< ms_peptide_quant_key > & toVector | ( | ) | const |
C++ conversion to std::vector.