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;
89 const std::string& symbol,
90 const unsigned int an,
91 const std::map<unsigned int, double>& abundance,
92 const std::map<unsigned int, double>& mass,
93 bool replace_existing);
115 double calculateAvgWeight_(
const std::map<unsigned int, double>& abundance,
const std::map<unsigned int, double>& mass);
119 double calculateMonoWeight_(
const std::map<unsigned int, double>& abundance,
const std::map<unsigned int, double>& mass);
125 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);
128 void addElementToMaps_(
const std::string& name,
const std::string& symbol,
const unsigned int an, std::unique_ptr<const Element> e);
131 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);
137 std::unordered_map<std::string, const Element*>
names_;
139 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:141
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:139
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:137
Representation of an element.
Definition: Element.h:32
Definition: IsotopeDistribution.h:39
Main OpenMS namespace.
Definition: openswathalgo/include/OpenMS/OPENSWATHALGO/DATAACCESS/ISpectrumAccess.h:19