The Gnome Chemistry Utils
0.14.0
|
#include <gcu/formula.h>
Public Member Functions | |
Formula (std::string entry, FormulaParseMode mode=GCU_FORMULA_PARSE_GUESS) throw (parse_error) | |
virtual | ~Formula () |
char const * | GetMarkup () |
std::map< int, int > & | GetRawFormula () |
char const * | GetRawMarkup () |
void | SetFormula (std::string entry) throw (parse_error) |
void | Clear () |
DimensionalValue | GetMolecularWeight (bool &artificial) |
void | CalculateIsotopicPattern (IsotopicPattern &pattern) |
std::list< FormulaElt * > const & | GetElements () const |
void | SetParseMode (FormulaParseMode val) |
FormulaParseMode | GetParseMode (void) const |
FormulaParseMode & | GetRefParseMode (void) |
This class interprets a chemical formula provided as a string and make some calculations using it. Currently, it is able to calculate the raw formula, the molecular weight and the isotopic pattern.
gcu::Formula::Formula | ( | std::string | entry, |
FormulaParseMode | mode = GCU_FORMULA_PARSE_GUESS |
||
) | throw (parse_error) |
entry,: | the formula to parse as a string. |
mode,: | the way ambiguous symbols shoud be interpreted. The constructor will emit a parse_error exception. if it cannot parse the given formula. |
|
virtual |
The destructor.
void gcu::Formula::CalculateIsotopicPattern | ( | IsotopicPattern & | pattern | ) |
pattern,: | the IsotopicPattern to be filled This method evaluates the isotopic pattern and fills the pattern parameter with the calculated data. |
void gcu::Formula::Clear | ( | ) |
Clears all data.
|
inline |
char const* gcu::Formula::GetMarkup | ( | ) |
DimensionalValue gcu::Formula::GetMolecularWeight | ( | bool & | artificial | ) |
artificial,: | will be true if the formula contains an artificial element (with no natural isotope). |
|
inline |
std::map<int,int>& gcu::Formula::GetRawFormula | ( | ) |
char const* gcu::Formula::GetRawMarkup | ( | ) |
|
inline |
void gcu::Formula::SetFormula | ( | std::string | entry | ) | throw (parse_error) |
entry,: | the formula to parse as a string. Calls Formula::Clear before parsing the new formula. The method will emit a parse_error exception if it cannot parse the given formula. |
|
inline |