Home  · Classes  · Annotated Classes  · Modules  · Members  · Namespaces  · Related Pages

ElementDB Class Reference
[Chemistry]

#include <OpenMS/CHEMISTRY/ElementDB.h>

List of all members.


Detailed Description

Stores elements.

The elements weights (in the default file) are taken from "Isotopic Compositions of the Elements 1997", Pure Appl. Chem., 70(1), 217-235, 1998. (http://www.iupac.org/reports/1998/7001rosman/)

The isotope distributions (in the default file) are taken from "Atomic weights of the elements. Review 2000" (IUPAC Technical Report) Pure Appl. Chem., 2003, Vol. 75, No. 6, pp. 683-799 doi:10.1351/pac200375060683

Accessors

static const ElementDBgetInstance ()
 returns a pointer to the singleton instance of the element db
const HashMap< String, const
Element * > & 
getNames () const
 returns a hashmap that contains names mapped to pointers to the elements
const HashMap< String, const
Element * > & 
getSymbols () const
 returns a hashmap that contains symbols mapped to pointers to the elements
const HashMap< UInt, const
Element * > & 
getAtomicNumbers () const
 returns a hashmap that contains atomic numbers mapped to pointers of the elements
const ElementgetElement (const String &name) const
const ElementgetElement (UInt atomic_number) const
 returns a pointer to the element of atomic number; if no element is found 0 is returned

Public Member Functions

Predicates
bool hasElement (const String &name) const
 returns true if the db contains an element with the given name
bool hasElement (UInt atomic_number) const
 returns true if the db contains an element with the given atomic_number

Protected Member Functions

IsotopeDistribution parseIsotopeDistribution_ (const HashMap< UInt, double > &distribution) throw (Exception::ParseError)
void readFromFile_ (const String &file_name) throw (Exception::FileNotFound, Exception::ParseError)
void clear_ ()

Protected Attributes

HashMap< String, const Element * > names_
HashMap< String, const Element * > symbols_
HashMap< UInt, const Element * > atomic_numbers_

Private Member Functions

 ElementDB ()
 ElementDB (const ElementDB &db)
ElementDBoperator= (const ElementDB &db)
virtual ~ElementDB ()


Constructor & Destructor Documentation

ElementDB (  )  [private]

ElementDB ( const ElementDB db  )  [private]

virtual ~ElementDB (  )  [private, virtual]


Member Function Documentation

static const ElementDB* getInstance (  )  [inline, static]

returns a pointer to the singleton instance of the element db

const HashMap<String, const Element*>& getNames (  )  const

returns a hashmap that contains names mapped to pointers to the elements

const HashMap<String, const Element*>& getSymbols (  )  const

returns a hashmap that contains symbols mapped to pointers to the elements

const HashMap<UInt, const Element*>& getAtomicNumbers (  )  const

returns a hashmap that contains atomic numbers mapped to pointers of the elements

const Element* getElement ( const String name  )  const

returns a pointer to the element with name or symbol given in parameter name; if no element exists with that name or symbol 0 is returned

Parameters:
name,: name or symbol of the element

const Element* getElement ( UInt  atomic_number  )  const

returns a pointer to the element of atomic number; if no element is found 0 is returned

bool hasElement ( const String name  )  const

returns true if the db contains an element with the given name

bool hasElement ( UInt  atomic_number  )  const

returns true if the db contains an element with the given atomic_number

IsotopeDistribution parseIsotopeDistribution_ ( const HashMap< UInt, double > &  distribution  )  throw (Exception::ParseError) [protected]

void readFromFile_ ( const String file_name  )  throw (Exception::FileNotFound, Exception::ParseError) [protected]

void clear_ (  )  [protected]

ElementDB& operator= ( const ElementDB db  )  [private]


Member Data Documentation

HashMap<String, const Element*> names_ [protected]

HashMap<String, const Element*> symbols_ [protected]

HashMap<UInt, const Element*> atomic_numbers_ [protected]


The documentation for this class was generated from the following file:
Generated Tue Apr 1 15:36:42 2008 -- using doxygen 1.5.4 OpenMS / TOPP 1.1