OpenMS
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>

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

Classes

class  Param
 

Public Types

typedef double CoordinateType
 
typedef ValueT PeakType
 
typedef SpectrumIteratorT SpectrumIteratorType
 
typedef PeakIteratorT PeakIteratorType
 
using SpectrumT = typename std::iterator_traits< SpectrumIteratorType >::value_type
 

Typedefs for STL compliance, these replace std::iterator

typedef std::forward_iterator_tag iterator_category
 The iterator's category type. More...
 
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...
 
Param p_
 holds spectra iterators and area limits More...
 
 AreaIterator (const Param &p)
 Constructor for the begin iterator. More...
 
 AreaIterator ()
 Default constructor (for the end iterator) More...
 
 ~AreaIterator ()=default
 Destructor. More...
 
 AreaIterator (const AreaIterator &rhs)=default
 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...
 
CoordinateType getDriftTime () const
 returns the ion mobility time of the current scan More...
 
const SpectrumTgetSpectrum () const
 returns the current scan into which the iterator points More...
 
PeakIndex getPeakIndex () const
 returns the PeakIndex corresponding to the current iterator position More...
 
void nextScan_ ()
 advances the iterator to the next valid peak in the next valid spectrum More...
 

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.

Ion mobility can also be filtered for: the low/high range for IM are used to skip over spectra in the given RT range whose drift time is not within the given range. I.e. the RT range could contain multiple IM frames.

Note
This iterator iterates over spectra with same MS level as the MS level of the begin() spectrum in Param! You can explicitly set another MS level as well.

Member Typedef Documentation

◆ CoordinateType

typedef double CoordinateType

◆ difference_type

typedef unsigned int difference_type

The difference type.

◆ iterator_category

typedef std::forward_iterator_tag iterator_category

The iterator's category 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

◆ SpectrumT

using SpectrumT = typename std::iterator_traits<SpectrumIteratorType>::value_type

◆ value_type

typedef ValueT value_type

The iterator's value type.

Constructor & Destructor Documentation

◆ AreaIterator() [1/3]

AreaIterator ( const Param p)
inlineexplicit

◆ AreaIterator() [2/3]

AreaIterator ( )
inline

Default constructor (for the end iterator)

◆ ~AreaIterator()

~AreaIterator ( )
default

Destructor.

◆ AreaIterator() [3/3]

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

Copy constructor.

Member Function Documentation

◆ getDriftTime()

◆ getPeakIndex()

◆ getRT()

◆ getSpectrum()

◆ nextScan_()

◆ operator!=()

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

Test for inequality.

◆ operator*()

◆ operator++() [1/2]

◆ operator++() [2/2]

AreaIterator operator++ ( int  )
inline

Step forward by one (postfix operator)

◆ operator->()

◆ operator=()

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

◆ operator==()

Member Data Documentation

◆ p_