OpenMS
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Modules Pages
AnnotatedMSRun::PairIterator< T1, T2 > Struct Template Reference

Iterator for pairs of spectra and peptide identifications. More...

#include <OpenMS/METADATA/AnnotatedMSRun.h>

Collaboration diagram for AnnotatedMSRun::PairIterator< T1, T2 >:
[legend]

Public Types

using iterator_category = std::forward_iterator_tag
 
using difference_type = std::ptrdiff_t
 

Public Member Functions

 PairIterator (T1 ptr1, T2 ptr2)
 Constructor. More...
 
PairIteratoroperator++ ()
 Pre-increment operator. More...
 
PairIterator operator++ (int)
 Post-increment operator. More...
 
auto operator* ()
 Dereference operator. More...
 

Private Attributes

T1 m_ptr1
 
T2 m_ptr2
 

Friends

bool operator== (const PairIterator &a, const PairIterator &b)
 Equality operator. More...
 
bool operator!= (const PairIterator &a, const PairIterator &b)
 Inequality operator. More...
 

Detailed Description

template<typename T1, typename T2>
struct OpenMS::AnnotatedMSRun::PairIterator< T1, T2 >

Iterator for pairs of spectra and peptide identifications.

This iterator allows traversing the spectra and their associated peptide identifications together.

Member Typedef Documentation

◆ difference_type

using difference_type = std::ptrdiff_t

◆ iterator_category

using iterator_category = std::forward_iterator_tag

Constructor & Destructor Documentation

◆ PairIterator()

PairIterator ( T1  ptr1,
T2  ptr2 
)
inline

Constructor.

Parameters
ptr1Iterator to the spectra
ptr2Iterator to the peptide identifications

Member Function Documentation

◆ operator*()

auto operator* ( )
inline

Dereference operator.

Returns
A pair of references to the current spectrum and peptide identification

◆ operator++() [1/2]

PairIterator& operator++ ( )
inline

Pre-increment operator.

Returns
Reference to this iterator after incrementing

◆ operator++() [2/2]

PairIterator operator++ ( int  )
inline

Post-increment operator.

Returns
Copy of this iterator before incrementing

Friends And Related Function Documentation

◆ operator!=

bool operator!= ( const PairIterator< T1, T2 > &  a,
const PairIterator< T1, T2 > &  b 
)
friend

Inequality operator.

Parameters
aFirst iterator
bSecond iterator
Returns
True if the iterators are not equal

◆ operator==

bool operator== ( const PairIterator< T1, T2 > &  a,
const PairIterator< T1, T2 > &  b 
)
friend

Equality operator.

Parameters
aFirst iterator
bSecond iterator
Returns
True if the iterators are equal

Member Data Documentation

◆ m_ptr1

T1 m_ptr1
private

◆ m_ptr2

T2 m_ptr2
private