ProteoWizard
Public Types | Public Member Functions | Private Attributes
pwiz::chemistry::Formula Class Reference

class to represent a chemical formula More...

#include <Chemistry.hpp>

List of all members.

Public Types

typedef std::map
< Element::Type, int > 
Map

Public Member Functions

 Formula (const std::string &formula="")
 formula string given by symbol/count pairs, e.g. water: "H2 O1" (whitespace optional)
 Formula (const char *formula)
 Formula (const Formula &formula)
const Formulaoperator= (const Formula &formula)
 ~Formula ()
double monoisotopicMass () const
double molecularWeight () const
std::string formula () const
int operator[] (Element::Type e) const
 access to the Element's count in the formula
int & operator[] (Element::Type e)
Map data () const
Formulaoperator+= (const Formula &that)
Formulaoperator-= (const Formula &that)
Formulaoperator*= (int scalar)
bool operator== (const Formula &that) const
 formulas are equal iff their elemental compositions are equal
bool operator!= (const Formula &that) const

Private Attributes

boost::shared_ptr< Impl > impl_

Detailed Description

class to represent a chemical formula

Definition at line 133 of file Chemistry.hpp.


Member Typedef Documentation

typedef std::map<Element::Type, int> pwiz::chemistry::Formula::Map

Definition at line 153 of file Chemistry.hpp.


Constructor & Destructor Documentation

pwiz::chemistry::Formula::Formula ( const std::string &  formula = "")

formula string given by symbol/count pairs, e.g. water: "H2 O1" (whitespace optional)

pwiz::chemistry::Formula::Formula ( const char *  formula)
pwiz::chemistry::Formula::Formula ( const Formula formula)
pwiz::chemistry::Formula::~Formula ( )

Member Function Documentation

const Formula& pwiz::chemistry::Formula::operator= ( const Formula formula)
double pwiz::chemistry::Formula::monoisotopicMass ( ) const
double pwiz::chemistry::Formula::molecularWeight ( ) const
std::string pwiz::chemistry::Formula::formula ( ) const
int pwiz::chemistry::Formula::operator[] ( Element::Type  e) const

access to the Element's count in the formula

int& pwiz::chemistry::Formula::operator[] ( Element::Type  e)
Map pwiz::chemistry::Formula::data ( ) const

Referenced by testFormula().

Formula& pwiz::chemistry::Formula::operator+= ( const Formula that)
Formula& pwiz::chemistry::Formula::operator-= ( const Formula that)
Formula& pwiz::chemistry::Formula::operator*= ( int  scalar)
bool pwiz::chemistry::Formula::operator== ( const Formula that) const

formulas are equal iff their elemental compositions are equal

bool pwiz::chemistry::Formula::operator!= ( const Formula that) const

Member Data Documentation

boost::shared_ptr<Impl> pwiz::chemistry::Formula::impl_
private

Definition at line 166 of file Chemistry.hpp.


The documentation for this class was generated from the following file: