OpenMS  2.7.0
Public Types | List of all members
AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT > Class Template Reference

Forward iterator for an area of peaks in an experiment. More...

#include <OpenMS/KERNEL/AreaIterator.h>

Inheritance diagram for AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >:
[legend]
Collaboration diagram for AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >:
[legend]

Public Types

typedef double CoordinateType
 
typedef ValueT PeakType
 
typedef SpectrumIteratorT SpectrumIteratorType
 
typedef PeakIteratorT PeakIteratorType
 

Typedefs for STL compliance

typedef ValueT value_type
 The iterator's value type. More...
 
typedef ReferenceT reference
 The reference type as returned by operator*() More...
 
typedef PointerT pointer
 The pointer type as returned by operator->() More...
 
typedef unsigned int difference_type
 The difference type. More...
 
SpectrumIteratorType first_
 Iterator to the first scan of the map (needed to calculate the index) More...
 
SpectrumIteratorType current_scan_
 Iterator to the current spectrum. More...
 
SpectrumIteratorType end_scan_
 Past-the-end iterator of spectra. More...
 
PeakIteratorType current_peak_
 Iterator to the current peak. More...
 
PeakIteratorType end_peak_
 Past-the-end iterator of peaks in the current spectrum. More...
 
CoordinateType low_mz_
 low m/z boundary More...
 
CoordinateType high_mz_
 high m/z boundary More...
 
bool is_end_
 Flag that indicates that this iterator is the end iterator. More...
 
 AreaIterator (SpectrumIteratorType first, SpectrumIteratorType begin, SpectrumIteratorType end, CoordinateType low_mz, CoordinateType high_mz)
 Constructor for the begin iterator. More...
 
 AreaIterator ()
 Default constructor (for the end iterator) More...
 
 ~AreaIterator ()
 Destructor. More...
 
 AreaIterator (const AreaIterator &rhs)
 Copy constructor. More...
 
AreaIteratoroperator= (const AreaIterator &rhs)
 Assignment operator. More...
 
bool operator== (const AreaIterator &rhs) const
 Test for equality. More...
 
bool operator!= (const AreaIterator &rhs) const
 Test for inequality. More...
 
AreaIteratoroperator++ ()
 Step forward by one (prefix operator) More...
 
AreaIterator operator++ (int)
 Step forward by one (postfix operator) More...
 
reference operator* () const
 Dereferencing of this pointer yields the underlying peak. More...
 
pointer operator-> () const
 Dereferencing of this pointer yields the underlying peak. More...
 
CoordinateType getRT () const
 returns the retention time of the current scan More...
 
PeakIndex getPeakIndex () const
 returns the PeakIndex corresponding to the current iterator position More...
 
void nextScan_ ()
 

Detailed Description

template<class ValueT, class ReferenceT, class PointerT, class SpectrumIteratorT, class PeakIteratorT>
class OpenMS::Internal::AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >

Forward iterator for an area of peaks in an experiment.

This iterator allows us to move through the data structure in a linear manner i.e. we don't need to jump to the next spectrum manually.

Note
This iterator iterates over spectra with MS level 1 only!

Member Typedef Documentation

◆ CoordinateType

typedef double CoordinateType

◆ difference_type

typedef unsigned int difference_type

The difference type.

◆ PeakIteratorType

typedef PeakIteratorT PeakIteratorType

◆ PeakType

typedef ValueT PeakType

◆ pointer

typedef PointerT pointer

The pointer type as returned by operator->()

◆ reference

typedef ReferenceT reference

The reference type as returned by operator*()

◆ SpectrumIteratorType

typedef SpectrumIteratorT SpectrumIteratorType

◆ value_type

typedef ValueT value_type

The iterator's value type.

Constructor & Destructor Documentation

◆ AreaIterator() [1/3]

◆ AreaIterator() [2/3]

AreaIterator ( )
inline

Default constructor (for the end iterator)

◆ ~AreaIterator()

~AreaIterator ( )
inline

Destructor.

◆ AreaIterator() [3/3]

AreaIterator ( const AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT > &  rhs)
inline

Copy constructor.

Member Function Documentation

◆ getPeakIndex()

PeakIndex getPeakIndex ( ) const
inline

◆ getRT()

CoordinateType getRT ( ) const
inline

◆ nextScan_()

void nextScan_ ( )
inlineprivate

◆ operator!=()

bool operator!= ( const AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT > &  rhs) const
inline

Test for inequality.

◆ operator*()

reference operator* ( ) const
inline

Dereferencing of this pointer yields the underlying peak.

References AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >::current_peak_.

◆ operator++() [1/2]

AreaIterator& operator++ ( )
inline

◆ operator++() [2/2]

AreaIterator operator++ ( int  )
inline

Step forward by one (postfix operator)

◆ operator->()

pointer operator-> ( ) const
inline

Dereferencing of this pointer yields the underlying peak.

References AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT >::current_peak_.

◆ operator=()

AreaIterator& operator= ( const AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT > &  rhs)
inline

◆ operator==()

bool operator== ( const AreaIterator< ValueT, ReferenceT, PointerT, SpectrumIteratorT, PeakIteratorT > &  rhs) const
inline

Member Data Documentation

◆ current_peak_

PeakIteratorType current_peak_
private

◆ current_scan_

SpectrumIteratorType current_scan_
private

◆ end_peak_

PeakIteratorType end_peak_
private

◆ end_scan_

SpectrumIteratorType end_scan_
private

◆ first_

SpectrumIteratorType first_
private

◆ high_mz_

CoordinateType high_mz_
private

◆ is_end_

bool is_end_
private

◆ low_mz_

CoordinateType low_mz_
private