43 #include <unordered_map>
82 const std::unordered_map<std::string, const Element*>&
getNames()
const;
85 const std::unordered_map<std::string, const Element*>&
getSymbols()
const;
112 const std::string& symbol,
113 const unsigned int an,
114 const std::map<unsigned int, double>& abundance,
115 const std::map<unsigned int, double>& mass,
116 bool replace_existing);
138 double calculateAvgWeight_(
const std::map<unsigned int, double>& abundance,
const std::map<unsigned int, double>& mass);
142 double calculateMonoWeight_(
const std::map<unsigned int, double>& abundance,
const std::map<unsigned int, double>& mass);
148 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);
151 void addElementToMaps_(
const std::string& name,
const std::string& symbol,
const unsigned int an, std::unique_ptr<const Element> e);
154 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);
160 std::unordered_map<std::string, const Element*>
names_;
162 std::unordered_map<std::string, const Element*>
symbols_;
Singleton that stores elements and isotopes.
Definition: ElementDB.h:71
std::unordered_map< unsigned int, const Element * > atomic_numbers_
Definition: ElementDB.h:164
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:162
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:160
Representation of an element.
Definition: Element.h:58
Definition: IsotopeDistribution.h:65
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:48