| [68cb0f] | 1 | #ifndef PERIODENTAFEL_HPP_
 | 
|---|
 | 2 | #define PERIODENTAFEL_HPP_
 | 
|---|
 | 3 | 
 | 
|---|
| [f66195] | 4 | /*********************************************** includes ***********************************/
 | 
|---|
 | 5 | 
 | 
|---|
| [68cb0f] | 6 | // include config.h
 | 
|---|
 | 7 | #ifdef HAVE_CONFIG_H
 | 
|---|
 | 8 | #include <config.h>
 | 
|---|
 | 9 | #endif
 | 
|---|
 | 10 | 
 | 
|---|
| [986ed3] | 11 | #include <iosfwd>
 | 
|---|
| [ead4e6] | 12 | #include <map>
 | 
|---|
| [68cb0f] | 13 | 
 | 
|---|
| [4eb4fe] | 14 | #include "unittests/periodentafelTest.hpp"
 | 
|---|
| [cd4ccc] | 15 | #include "defs.hpp"
 | 
|---|
| [ead4e6] | 16 | #include "types.hpp"
 | 
|---|
| [68cb0f] | 17 | 
 | 
|---|
| [f66195] | 18 | /****************************************** forward declarations *****************************/
 | 
|---|
 | 19 | 
 | 
|---|
 | 20 | class element;
 | 
|---|
 | 21 | 
 | 
|---|
 | 22 | /********************************************** declarations *******************************/
 | 
|---|
| [6ac7ee] | 23 | 
 | 
|---|
| [68cb0f] | 24 | 
 | 
|---|
 | 25 | /** Periodentafel is a list of all elements sorted by their atomic number.
 | 
|---|
 | 26 |  */
 | 
|---|
 | 27 | class periodentafel {
 | 
|---|
| [ead4e6] | 28 |   /******* Types *********/
 | 
|---|
| [4eb4fe] | 29 |   friend class periodentafelTest;
 | 
|---|
| [ead4e6] | 30 |   private:
 | 
|---|
 | 31 |     typedef std::map<atomicNumber_t,element*> elementSet;
 | 
|---|
 | 32 |   public:
 | 
|---|
 | 33 |     typedef elementSet::iterator iterator;
 | 
|---|
 | 34 |     typedef elementSet::const_iterator const_iterator;
 | 
|---|
 | 35 |     typedef std::reverse_iterator<const_iterator> reverse_iterator;
 | 
|---|
| [042f82] | 36 |   public:
 | 
|---|
| [ead4e6] | 37 | 
 | 
|---|
| [042f82] | 38 |     char header1[MAXSTRINGSIZE]; //!< store first header line
 | 
|---|
 | 39 |     char header2[MAXSTRINGSIZE]; //!< store second header line
 | 
|---|
| [6ac7ee] | 40 | 
 | 
|---|
| [042f82] | 41 |   periodentafel();
 | 
|---|
 | 42 |   ~periodentafel();
 | 
|---|
| [6ac7ee] | 43 | 
 | 
|---|
| [ead4e6] | 44 |   iterator AddElement(element * const pointer);
 | 
|---|
| [61745cc] | 45 |   size_t RemoveElement(element * const pointer);
 | 
|---|
 | 46 |   size_t RemoveElement(atomicNumber_t);
 | 
|---|
| [ead4e6] | 47 |   void CleanupPeriodtable();
 | 
|---|
| [4eb4fe] | 48 |   element * const FindElement(atomicNumber_t) const;
 | 
|---|
 | 49 |   element * const FindElement(const char * const shorthand) const;
 | 
|---|
 | 50 |   element * const AskElement() const;
 | 
|---|
 | 51 |   element * const EnterElement();
 | 
|---|
| [ead4e6] | 52 | 
 | 
|---|
 | 53 |   const_iterator begin();
 | 
|---|
 | 54 |   const_iterator end();
 | 
|---|
 | 55 |   reverse_iterator rbegin();
 | 
|---|
 | 56 |   reverse_iterator rend();
 | 
|---|
 | 57 |   bool Output(std::ostream * const output) const;
 | 
|---|
 | 58 |   bool Checkout(std::ostream * const output, const int * const checkliste) const;
 | 
|---|
| [fb73b8] | 59 |   bool LoadPeriodentafel(const char * const path);
 | 
|---|
 | 60 |   bool StorePeriodentafel(const char * const path) const;
 | 
|---|
| [6ac7ee] | 61 | 
 | 
|---|
| [042f82] | 62 |   private:
 | 
|---|
| [4eb4fe] | 63 | 
 | 
|---|
 | 64 |   bool LoadElementsDatabase(std::istream *input);
 | 
|---|
 | 65 |   bool LoadValenceDatabase(std::istream *input);
 | 
|---|
 | 66 |   bool LoadOrbitalsDatabase(std::istream *input);
 | 
|---|
 | 67 |   bool LoadHBondAngleDatabase(std::istream *input);
 | 
|---|
 | 68 |   bool LoadHBondLengthsDatabase(std::istream *input);
 | 
|---|
 | 69 | 
 | 
|---|
| [ead4e6] | 70 |     elementSet elements;
 | 
|---|
| [68cb0f] | 71 | };
 | 
|---|
 | 72 | 
 | 
|---|
 | 73 | 
 | 
|---|
 | 74 | #endif /*PERIODENTAFEL_HPP_*/
 | 
|---|