| OpenMS 2.5.0

Public Member Functions | Protected Attributes | List of all members
HasScanPolarity< SpectrumType > Class Template Reference
Kernel » RangeUtils

Predicate that determines if a spectrum has a certain scan polarity. More...

`#include <OpenMS/KERNEL/RangeUtils.h>`

Inheritance diagram for HasScanPolarity< SpectrumType >:

## Public Member Functions

| HasScanPolarity (Int polarity, bool reverse=false)
| Constructor. More...
bool | operator() (const SpectrumType &s) const

## Protected Attributes

Int | polarity_
bool | reverse_

## Detailed Description

### template<class SpectrumType>
class OpenMS::HasScanPolarity< SpectrumType >

Predicate that determines if a spectrum has a certain scan polarity.

SpectrumType must be a Spectrum or have the same interface (SpectrumSettings)

## Constructor & Destructor Documentation

## ◆ HasScanPolarity()

HasScanPolarity | ( | Int | polarity,
|  | bool | reverse = `false`
| ) |  |

inline

Constructor.

Parameters

  mode | scan polarity
  reverse | if `reverse` is true, operator() returns true if the spectrum has a different scan polarity

## Member Function Documentation

## ◆ operator()()

bool operator() | ( | const SpectrumType & | s | ) | const

inline

References SpectrumSettings::getInstrumentSettings(), InstrumentSettings::getPolarity(), HasScanPolarity< SpectrumType >::polarity_, and HasScanPolarity< SpectrumType >::reverse_.

## Member Data Documentation

## ◆ polarity_

Int polarity_

protected

Referenced by HasScanPolarity< SpectrumType >::operator()().

## ◆ reverse_

bool reverse_

protected

Referenced by HasScanPolarity< SpectrumType >::operator()().