42 #include <unordered_map>
81 const std::unordered_map<std::string, const Element*>&
getNames()
const;
84 const std::unordered_map<std::string, const Element*>&
getSymbols()
const;
111 const std::string& symbol,
112 const unsigned int an,
113 const std::map<unsigned int, double>& abundance,
114 const std::map<unsigned int, double>& mass,
115 bool replace_existing);
137 double calculateAvgWeight_(
const std::map<unsigned int, double>& abundance,
const std::map<unsigned int, double>& mass);
141 double calculateMonoWeight_(
const std::map<unsigned int, double>& abundance,
const std::map<unsigned int, double>& mass);
147 void buildElement_(
const std::string& name,
const std::string& symbol,
const unsigned int an,
const std::map<unsigned int, double>& abundance,
const std::map<unsigned int, double>& mass);
153 void storeIsotopes_(
const std::string& name,
const std::string& symbol,
const unsigned int an,
const std::map<unsigned int, double>& Z_to_mass,
const IsotopeDistribution& isotopes);
159 std::unordered_map<std::string, const Element*>
names_;
161 std::unordered_map<std::string, const Element*>
symbols_;
Singleton that stores elements and isotopes.
Definition: ElementDB.h:70
std::unordered_map< unsigned int, const Element * > atomic_numbers_
Definition: ElementDB.h:163
IsotopeDistribution parseIsotopeDistribution_(const std::map< unsigned int, double > &abundance, const std::map< unsigned int, double > &mass)
void addElementToMaps_(const std::string &name, const std::string &symbol, const unsigned int an, const Element *e)
add element objects to documentation maps
ElementDB(const ElementDB &&db)=delete
std::unordered_map< std::string, const Element * > symbols_
Definition: ElementDB.h:161
const Element * getElement(unsigned int atomic_number) const
returns a pointer to the element of atomic number; if no element is found 0 is returned
void buildElement_(const std::string &name, const std::string &symbol, const unsigned int an, const std::map< unsigned int, double > &abundance, const std::map< unsigned int, double > &mass)
build element objects from given abundances, masses, name, symbol, and atomic number
ElementDB & operator=(const ElementDB &db)=delete
ElementDB(const ElementDB &db)=delete
const std::unordered_map< unsigned int, const Element * > & getAtomicNumbers() const
returns a hashmap that contains atomic numbers mapped to pointers of the elements
bool hasElement(unsigned int atomic_number) const
returns true if the db contains an element with the given atomic_number
void addElement(const std::string &name, const std::string &symbol, const unsigned int an, const std::map< unsigned int, double > &abundance, const std::map< unsigned int, double > &mass, bool replace_existing)
const std::unordered_map< std::string, const Element * > & getNames() const
returns a hashmap that contains names mapped to pointers to the elements
double calculateMonoWeight_(const std::map< unsigned int, double > &abundance, const std::map< unsigned int, double > &mass)
const Element * getElement(const std::string &name) const
static ElementDB * getInstance()
bool hasElement(const std::string &name) const
returns true if the db contains an element with the given name
void storeElements_()
constructs element objects
double calculateAvgWeight_(const std::map< unsigned int, double > &abundance, const std::map< unsigned int, double > &mass)
const std::unordered_map< std::string, const Element * > & getSymbols() const
returns a hashmap that contains symbols mapped to pointers to the elements
void storeIsotopes_(const std::string &name, const std::string &symbol, const unsigned int an, const std::map< unsigned int, double > &Z_to_mass, const IsotopeDistribution &isotopes)
constructs isotope objects
std::unordered_map< std::string, const Element * > names_
Definition: ElementDB.h:159
Representation of an element.
Definition: Element.h:58
Definition: IsotopeDistribution.h:65
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:48