OpenMS  2.6.0
Classes | Public Member Functions | Protected Attributes | List of all members
Peak1D Class Reference

A 1-dimensional raw data point or peak. More...

#include <OpenMS/KERNEL/Peak1D.h>

Inheritance diagram for Peak1D:
[legend]
Collaboration diagram for Peak1D:
[legend]

Classes

struct  IntensityLess
 
struct  MZLess
 Comparator by m/z position. More...
 
struct  PositionLess
 Comparator by position. As this class has dimension 1, this is basically an alias for MZLess. More...
 

Public Types

Type definitions

Dimension

enum  { DIMENSION = 1 }
 
typedef float IntensityType
 Intensity type. More...
 
typedef DPosition< 1 > PositionType
 Position type. More...
 
typedef double CoordinateType
 Coordinate type. More...
 

Public Member Functions

Peak1Doperator= (const Peak1D &rhs)
 Assignment operator. More...
 
bool operator== (const Peak1D &rhs) const
 Equality operator. More...
 
bool operator!= (const Peak1D &rhs) const
 Equality operator. More...
 
Constructors and Destructor

Default constructor

 Peak1D ()
 
 Peak1D (PositionType a, IntensityType b)
 construct with position and intensity More...
 
 Peak1D (const Peak1D &p)
 Copy constructor. More...
 
 Peak1D (Peak1D &&) noexcept=default
 
 ~Peak1D ()
 Destructor. More...
 
Accessors
IntensityType getIntensity () const
 
void setIntensity (IntensityType intensity)
 Mutable access to the data point intensity (height) More...
 
CoordinateType getMZ () const
 Non-mutable access to m/z. More...
 
void setMZ (CoordinateType mz)
 Mutable access to m/z. More...
 
CoordinateType getPos () const
 Alias for getMZ() More...
 
void setPos (CoordinateType pos)
 Alias for setMZ() More...
 
const PositionTypegetPosition () const
 Non-mutable access to the position. More...
 
PositionTypegetPosition ()
 Mutable access to the position. More...
 
void setPosition (PositionType const &position)
 Mutable access to the position. More...
 

Protected Attributes

PositionType position_
 The data point position. More...
 
IntensityType intensity_
 The data point intensity. More...
 

Detailed Description

A 1-dimensional raw data point or peak.

This data structure is intended for continuous data or peak data. If you want to annotated single peaks with meta data, use RichPeak1D instead.

Member Typedef Documentation

◆ CoordinateType

Coordinate type.

◆ IntensityType

Intensity type.

◆ PositionType

typedef DPosition<1> PositionType

Position type.

Member Enumeration Documentation

◆ anonymous enum

anonymous enum
Enumerator
DIMENSION 

Constructor & Destructor Documentation

◆ Peak1D() [1/4]

Peak1D ( )
inline

◆ Peak1D() [2/4]

Peak1D ( PositionType  a,
IntensityType  b 
)
inline

construct with position and intensity

◆ Peak1D() [3/4]

Peak1D ( const Peak1D p)
inline

Copy constructor.

◆ Peak1D() [4/4]

Peak1D ( Peak1D &&  )
defaultnoexcept

◆ ~Peak1D()

~Peak1D ( )
inline

Destructor.

Note
The destructor is non-virtual although many classes are derived from Peak1D. This is intentional, since otherwise we would "waste" space for a vtable pointer in each instance. Normally you should not derive other classes from Peak1D (unless you know what you are doing, of course).

Member Function Documentation

◆ getIntensity()

IntensityType getIntensity ( ) const
inline

Non-mutable access to the data point intensity (height)

Referenced by DTA2DFile::load(), and Peak1D::IntensityLess::operator()().

◆ getMZ()

CoordinateType getMZ ( ) const
inline

◆ getPos()

CoordinateType getPos ( ) const
inline

Alias for getMZ()

◆ getPosition() [1/2]

PositionType& getPosition ( )
inline

Mutable access to the position.

◆ getPosition() [2/2]

const PositionType& getPosition ( ) const
inline

Non-mutable access to the position.

Referenced by Peak1D::PositionLess::operator()().

◆ operator!=()

bool operator!= ( const Peak1D rhs) const
inline

Equality operator.

References OpenMS::Internal::operator==().

◆ operator=()

Peak1D& operator= ( const Peak1D rhs)
inline

Assignment operator.

References Peak1D::intensity_, and Peak1D::position_.

◆ operator==()

bool operator== ( const Peak1D rhs) const
inline

Equality operator.

References Peak1D::intensity_, and Peak1D::position_.

◆ setIntensity()

void setIntensity ( IntensityType  intensity)
inline

◆ setMZ()

void setMZ ( CoordinateType  mz)
inline

◆ setPos()

void setPos ( CoordinateType  pos)
inline

Alias for setMZ()

◆ setPosition()

void setPosition ( PositionType const &  position)
inline

Member Data Documentation

◆ intensity_

IntensityType intensity_
protected

The data point intensity.

Referenced by Peak1D::operator=(), and Peak1D::operator==().

◆ position_

PositionType position_
protected

The data point position.

Referenced by Peak1D::operator=(), and Peak1D::operator==().