|
The Ponderable class provides an abstraction for any chemical entity having a monoisotopic and an average mass. More...
Header: | #include <Ponderable.hpp> |
Inherited By: | MsXpS::libXpertMass::CrossLinker, MsXpS::libXpertMass::Ionizable, MsXpS::libXpertMass::Modif, and MsXpS::libXpertMass::Monomer |
Ponderable(double mono = 0, double avg = 0) | |
Ponderable(const Ponderable &other) | |
virtual | ~Ponderable() |
virtual bool | accountMasses(double *mono = 0, double *avg = 0, int times = 1) const |
double | avg() const |
QString | avgString(int decimalPlaces) const |
void | clearMasses() |
void | decrementAvg(double mass) |
void | decrementMono(double mass) |
void | incrementAvg(double mass) |
void | incrementMass(double mass, MassType type) |
void | incrementMono(double mass) |
double | mass(MassType type) const |
void | masses(double *mono = 0, double *avg = 0) const |
double | mono() const |
QString | monoString(int decimalPlaces) const |
double & | ravg() |
double & | rmono() |
void | setAvg(double mass) |
bool | setAvg(const QString &mass) |
void | setMass(double mass, MassType type) |
void | setMasses(double mono, double avg) |
void | setMono(double mass) |
bool | setMono(const QString &mass) |
virtual bool | operator!=(const Ponderable &other) const |
virtual Ponderable & | operator=(const Ponderable &other) |
virtual bool | operator==(const Ponderable &other) const |
Functions are provided to modify the member masses.
Constructs a ponderable initializing its masses with mono and avg.
Constructs a ponderable initializing it using other.
[virtual noexcept]
Ponderable::~Ponderable()Destructs the ponderable.
[virtual]
bool Ponderable::accountMasses(double *mono = 0, double *avg = 0, int times = 1) constIncrease the member masses by adding either mono and or avg compounded by times.
The monoisotopic mass is increased if mono is not nullptr. The mono value is compounded by times and the result is added to the member monoisotopic datum.
The average mass is increased if avg is not nullptr. The avg value is compounded by times and the result is added to the member average datum.
Always returns true.
Returns the average mass.
See also setAvg().
Returns a string representing the average mass using decimalPlaces for the precision.
Sets the member data masses to 0.0.
Decrements the average mass by subtracting mass.
Decrements the monoisotopic mass by subtracting mass.
Increments the average mass by adding mass.
Add to the member data the mass value in mass.
The member datum that is modified depends on the value of type.
Increments the monoisotopic mass by adding mass.
Returns the mass depending on the type.
See also setMass().
Sets the mono and avg to the corresponding member data values.
The pointer arguments cannot be nullptr.
See also setMasses().
Returns the monoisotopic mass.
See also setMono().
Returns a string representing the monoisotopic mass using decimalPlaces for the precision.
Returns a reference to the average mass.
Returns a reference to the monoisotopic mass.
Sets the average mass to mass.
See also avg().
Sets the average mass to mass.
The mass string is converted to double.
Returns true if the conversion succceeded, false otherwise.
Initializes the member data using mass.
The member datum that is initialized depends on the value of type.
See also mass().
Initializes the member data using mono and avg.
See also masses().
Sets the monoisotopic mass to mass.
See also mono().
Sets the monoisotopic mass to mass.
The mass string is converted to double.
Returns true if the conversion succceeded, false otherwise.
[virtual]
bool Ponderable::operator!=(const Ponderable &other) constReturns true if other and this ponderable have at least one differing mass, false otherwise.
[virtual]
Ponderable &Ponderable::operator=(const Ponderable &other)Assigns to this Ponderable' member data the values in other.
Returns a reference to this Ponderable
[virtual]
bool Ponderable::operator==(const Ponderable &other) constReturns true if other and this ponderable have the same masses, false otherwise.
This variable holds the average mass.
This variable holds the monoisotopic mass.