OpenMS  2.8.0
Public Member Functions | Protected Attributes | List of all members
Gradient Class Reference

Representation of a HPLC gradient. More...

#include <OpenMS/METADATA/Gradient.h>

Collaboration diagram for Gradient:
[legend]

Public Member Functions

 Gradient ()=default
 Constructor. More...
 
 Gradient (const Gradient &)=default
 Copy constructor. More...
 
 Gradient (Gradient &&)=default
 Move constructor. More...
 
 ~Gradient ()
 Destructor. More...
 
Gradientoperator= (const Gradient &)=default
 Assignment operator. More...
 
Gradientoperator= (Gradient &&) &=default
 Move assignment operator. More...
 
bool operator== (const Gradient &source) const
 Equality operator. More...
 
bool operator!= (const Gradient &source) const
 Equality operator. More...
 
void addEluent (const String &eluent)
 Adds an eluent at the end of the eluent array. More...
 
void clearEluents ()
 removes all eluents More...
 
const std::vector< String > & getEluents () const
 returns a const reference to the list of eluents More...
 
void addTimepoint (Int timepoint)
 Adds a timepoint at the end of the timepoint array. More...
 
void clearTimepoints ()
 removes all timepoints More...
 
const std::vector< Int > & getTimepoints () const
 returns a const reference to the list of timepoints More...
 
void setPercentage (const String &eluent, Int timepoint, UInt percentage)
 sets the percentage of eluent eluent at timepoint timepoint More...
 
const std::vector< std::vector< UInt > > & getPercentages () const
 returns a const reference to the percentages More...
 
UInt getPercentage (const String &eluent, Int timepoint) const
 returns the percentage of an eluent at a timepoint More...
 
void clearPercentages ()
 sets all percentage values to 0 More...
 
bool isValid () const
 checks if the percentages of all timepoints add up to 100% More...
 

Protected Attributes

std::vector< Stringeluents_
 
std::vector< Inttimes_
 
std::vector< std::vector< UInt > > percentages_
 

Detailed Description

Representation of a HPLC gradient.

It consists of several eluents and timepoints. Linear behaviour between timepoints is assumed.

Constructor & Destructor Documentation

◆ Gradient() [1/3]

Gradient ( )
default

Constructor.

◆ Gradient() [2/3]

Gradient ( const Gradient )
default

Copy constructor.

◆ Gradient() [3/3]

Gradient ( Gradient &&  )
default

Move constructor.

◆ ~Gradient()

~Gradient ( )

Destructor.

Member Function Documentation

◆ addEluent()

void addEluent ( const String eluent)

Adds an eluent at the end of the eluent array.

Exceptions
Exception::InvalidValueis thrown if the same eluent name is used twice.

◆ addTimepoint()

void addTimepoint ( Int  timepoint)

Adds a timepoint at the end of the timepoint array.

Exceptions
Exception::OutOfRangeis thrown if the new timepoint is before the last timepoint.

◆ clearEluents()

void clearEluents ( )

removes all eluents

◆ clearPercentages()

void clearPercentages ( )

sets all percentage values to 0

◆ clearTimepoints()

void clearTimepoints ( )

removes all timepoints

◆ getEluents()

const std::vector<String>& getEluents ( ) const

returns a const reference to the list of eluents

◆ getPercentage()

UInt getPercentage ( const String eluent,
Int  timepoint 
) const

returns the percentage of an eluent at a timepoint

Exceptions
Exception::InvalidValueis thrown if the eluent or timepoint is invalid.

◆ getPercentages()

const std::vector<std::vector<UInt> >& getPercentages ( ) const

returns a const reference to the percentages

First dimension of the vector is the eluents, second dimension is the timepoints.

◆ getTimepoints()

const std::vector<Int>& getTimepoints ( ) const

returns a const reference to the list of timepoints

◆ isValid()

bool isValid ( ) const

checks if the percentages of all timepoints add up to 100%

◆ operator!=()

bool operator!= ( const Gradient source) const

Equality operator.

◆ operator=() [1/2]

Gradient& operator= ( const Gradient )
default

Assignment operator.

◆ operator=() [2/2]

Gradient& operator= ( Gradient &&  ) &
default

Move assignment operator.

◆ operator==()

bool operator== ( const Gradient source) const

Equality operator.

◆ setPercentage()

void setPercentage ( const String eluent,
Int  timepoint,
UInt  percentage 
)

sets the percentage of eluent eluent at timepoint timepoint

Exceptions
Exception::InvalidValueis thrown if the eluent, timepoint or percentage is invalid.

Member Data Documentation

◆ eluents_

std::vector<String> eluents_
protected

◆ percentages_

std::vector<std::vector<UInt> > percentages_
protected

◆ times_

std::vector<Int> times_
protected