Matrix Science Mascot Parser toolkit
 
Loading...
Searching...
No Matches
ms_peptide_quant_key_vector Class Reference

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_vectoroperator= (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.
 

Detailed Description

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#.

Constructor & Destructor Documentation

◆ ms_peptide_quant_key_vector() [1/2]

ms_peptide_quant_key_vector ( const std::vector< ms_peptide_quant_key > &  v)
explicit

Create a peptide quant key vector from an STL vector.

Note
This constructor can only be used from C++.
Parameters
vSTL vector to initialise with.

◆ ms_peptide_quant_key_vector() [2/2]

ms_peptide_quant_key_vector ( const std::list< ms_peptide_quant_key > &  v)
explicit

Create a peptide quant key vector from an STL list.

Note
This constructor can only be used from C++.
Parameters
vSTL list to initialise with.

Member Function Documentation

◆ append()

void append ( const ms_peptide_quant_key_vector src)

Appends all content from another instance of the class.

Parameters
srcis another ms_peptide_quant_key_vector to append the keys from.

◆ clear()

void clear ( )

Clear the vector.

After clear, the vector will be empty.

◆ empty()

bool empty ( ) const

Boolean test: is the vector empty?

Returns
True if the vector is empty (has size 0); false otherwise.

◆ get()

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.

Parameters
idxThe element index, 0..size()-1.
Returns
The element at the corresponding index.

◆ 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.

Returns
The value popped from the end of the vector.

◆ push()

void push ( const ms_peptide_quant_key key)

Push a new peptide quant key at the end of the vector.

Parameters
keyKey to append to the vector.

◆ set()

void set ( int  idx,
const ms_peptide_quant_key key 
)

Set the value at the given index.

Note that idx must be within the 0-indexed range. Otherwise the method will throw an exception. If you need to extend the vector, use push().

Parameters
idxThe element index, 0..size()-1.
keyThe new value to be set at that index.

◆ size()

int size ( ) const

Return the size of the container.

Returns
The number of elements in the vector, or 0 if the vector is empty.

◆ swap()

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.

Parameters
srcPeptide quant key vector to swap contents with.

◆ toVector()

const std::vector< ms_peptide_quant_key > & toVector ( ) const

C++ conversion to std::vector.

Note
This method can only be used from C++.
Returns
A copy of the peptide quant key vector as an STL vector.

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