17 #include <unordered_map>
56 const std::unordered_map<std::string, const Element*>&
getNames()
const;
59 const std::unordered_map<std::string, const Element*>&
getSymbols()
const;
86 const std::string& symbol,
87 const unsigned int an,
88 const std::map<unsigned int, double>& abundance,
89 const std::map<unsigned int, double>& mass,
90 bool replace_existing);
112 double calculateAvgWeight_(
const std::map<unsigned int, double>& abundance,
const std::map<unsigned int, double>& mass);
116 double calculateMonoWeight_(
const std::map<unsigned int, double>& abundance,
const std::map<unsigned int, double>& mass);
122 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);
125 void addElementToMaps_(
const std::string& name,
const std::string& symbol,
const unsigned int an, std::unique_ptr<const Element> e);
128 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);
134 std::unordered_map<std::string, const Element*>
names_;
136 std::unordered_map<std::string, const Element*>
symbols_;
Singleton that stores elements and isotopes.
Definition: ElementDB.h:45
std::unordered_map< unsigned int, const Element * > atomic_numbers_
Definition: ElementDB.h:138
IsotopeDistribution parseIsotopeDistribution_(const std::map< unsigned int, double > &abundance, const std::map< unsigned int, double > &mass)
ElementDB(const ElementDB &&db)=delete
std::unordered_map< std::string, const Element * > symbols_
Definition: ElementDB.h:136
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
void addElementToMaps_(const std::string &name, const std::string &symbol, const unsigned int an, std::unique_ptr< const Element > e)
add element objects to documentation maps
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:134
Representation of an element.
Definition: Element.h:32
Definition: IsotopeDistribution.h:39
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:22