1 | #ifndef PERIODENTAFEL_HPP_
|
---|
2 | #define PERIODENTAFEL_HPP_
|
---|
3 |
|
---|
4 | /*********************************************** includes ***********************************/
|
---|
5 |
|
---|
6 | // include config.h
|
---|
7 | #ifdef HAVE_CONFIG_H
|
---|
8 | #include <config.h>
|
---|
9 | #endif
|
---|
10 |
|
---|
11 | #include <iosfwd>
|
---|
12 | #include <map>
|
---|
13 |
|
---|
14 | #include "unittests/periodentafelTest.hpp"
|
---|
15 | #include "defs.hpp"
|
---|
16 | #include "types.hpp"
|
---|
17 |
|
---|
18 | /****************************************** forward declarations *****************************/
|
---|
19 |
|
---|
20 | class element;
|
---|
21 |
|
---|
22 | /********************************************** declarations *******************************/
|
---|
23 |
|
---|
24 |
|
---|
25 | /** Periodentafel is a list of all elements sorted by their atomic number.
|
---|
26 | */
|
---|
27 | class periodentafel {
|
---|
28 | /******* Types *********/
|
---|
29 | friend class periodentafelTest;
|
---|
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;
|
---|
36 | public:
|
---|
37 |
|
---|
38 | char header1[MAXSTRINGSIZE]; //!< store first header line
|
---|
39 | char header2[MAXSTRINGSIZE]; //!< store second header line
|
---|
40 |
|
---|
41 | periodentafel();
|
---|
42 | ~periodentafel();
|
---|
43 |
|
---|
44 | iterator AddElement(element * const pointer);
|
---|
45 | size_t RemoveElement(element * const pointer);
|
---|
46 | size_t RemoveElement(atomicNumber_t);
|
---|
47 | void CleanupPeriodtable();
|
---|
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();
|
---|
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;
|
---|
59 | bool LoadPeriodentafel(const char * const path);
|
---|
60 | bool StorePeriodentafel(const char * const path) const;
|
---|
61 |
|
---|
62 | private:
|
---|
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 |
|
---|
70 | elementSet elements;
|
---|
71 | };
|
---|
72 |
|
---|
73 |
|
---|
74 | #endif /*PERIODENTAFEL_HPP_*/
|
---|