BALL 1.5.0
PTE.h
Go to the documentation of this file.
1// -*- Mode: C++; tab-width: 2; -*-
2// vi: set ts=2:
3//
4// $Id: PTE.h,v 1.30.16.1 2007/03/25 21:23:42 oliver Exp $
5//
6
7#ifndef BALL_KERNEL_PTE_H
8#define BALL_KERNEL_PTE_H
9
10#ifndef BALL_COMMON_CREATE_H
11# include <BALL/COMMON/create.h>
12#endif
13
14#ifndef BALL_DATATYPE_STRING_H
15# include <BALL/DATATYPE/string.h>
16#endif
17
18#ifndef BALL_CONCEPT_PROCESSOR_H
20#endif
21
22#define BALL_ELEMENT_NAME_DEFAULT "Unknown"
23#define BALL_ELEMENT_SYMBOL_DEFAULT "?"
24#define BALL_ELEMENT_GROUP_DEFAULT 0
25#define BALL_ELEMENT_PERIOD_DEFAULT 0
26#define BALL_ELEMENT_ATOMICNUMBER_DEFAULT 0
27#define BALL_ELEMENT_ATOMICWEIGHT_DEFAULT 0
28#define BALL_ELEMENT_ATOMICRADIUS_DEFAULT 0
29#define BALL_ELEMENT_COVALENTRADIUS_DEFAULT 0
30#define BALL_ELEMENT_VANDERWAALSRADIUS_DEFAULT 0
31#define BALL_ELEMENT_ELECTRONEGATIVITY_DEFAULT 0
32#define BALL_ELEMENT_IS_METAL_DEFAULT false
33
34
35namespace BALL
36{
50
55 {
56 public:
57
59
60
62 typedef short Group;
63
66 typedef short Period;
67
70 typedef short AtomicNumber;
71
75 enum Name
76 {
77 ACTINIUM = 0,
80 ANTIMONY, STIBIUM = ANTIMONY,
87 BISMUTH, WISMUT = BISMUTH,
95 CARBON, CARBONEUM = CARBON,
100 COPPER, CUPRUM = COPPER,
113 GOLD, AURUM = GOLD,
118 HYDROGEN, HYDROGENIUM = HYDROGEN,
122 IRON, FERRUM = IRON,
127 LEAD, PLUMBUM = LEAD,
131 MANGANESE, MANGAN = MANGANESE,
134 MERCURY, HYDRARGYRUM = MERCURY, MERCURIUM = MERCURY,
141 NITROGEN, NITROGENIUM = NITROGEN,
144 OXYGEN, OXYGENIUM = OXYGEN,
150 POTASSIUM, KALIUM = POTASSIUM,
164 SILICON, SILICIUM = SILICON,
165 SILVER, ARGENTUM = SILVER,
166 SODIUM, NATRIUM = SODIUM,
168 SULPHUR, SULFUR = SULPHUR,
176 TIN, STANNUM = TIN,
178 TUNGSTEN, WOLFRAM = TUNGSTEN,
187 ZINC, ZINCUM = ZINC,
189
190 NUMBER_OF_ELEMENTS // 111
191 };
192
197 {
198 Ac = 0,
309 Zr
310 };
311
315
321
324 Element(const Element& element);
325
329 (const String& name,
330 const String& symbol,
331 Group group,
332 Period period,
333 AtomicNumber atomic_umber,
334 float atomic_weight,
335 float atomic_radius,
336 float covalent_radius,
337 float van_der_waals_radius,
338 bool is_metal,
339 float electronegativity);
340
343 virtual ~Element();
344
349 virtual void clear();
350
352
355
360 Element& operator = (const Element& element);
361
363
366
370 void setName(const String& name);
371
377 const String& getName() const;
378
382 void setSymbol(const String& symbol);
383
387 const String& getSymbol() const;
388
392 void setGroup(Group group);
393
398
402 void setPeriod(Period period);
403
408
412 void setAtomicNumber(AtomicNumber atomic_number);
413
418
422 void setAtomicWeight(float atomic_weight);
423
427 float getAtomicWeight() const;
428
432 void setAtomicRadius(float atomic_radius);
433
437 float getAtomicRadius() const;
438
442 void setCovalentRadius(float covalent_radius);
443
447 float getCovalentRadius() const;
448
452 void setVanDerWaalsRadius(float van_der_waals_radius);
453
457 float getVanDerWaalsRadius() const;
458
462 void setElectronegativity(float electronegativity);
463
467 float getElectronegativity() const;
468
470
473
479 bool operator == (const Element& element) const;
480
486 bool operator != (const Element& element) const;
487
494 bool operator < (const Element& element) const;
495
502 bool operator <= (const Element& element) const;
503
510 bool operator >= (const Element& element) const;
511
518 bool operator >(const Element& element) const;
519
524 friend std::ostream& operator << (std::ostream& s, const Element& element);
525
527
530
536 bool isUnknown() const;
537
543 bool isMetal() const;
544
546
551
552
553 private:
554
557 String name_;
558
561 String symbol_;
562
600 Group group_;
601
604 Period period_;
605
609 AtomicNumber atomic_number_;
610
618 float atomic_weight_;
619
622 float atomic_radius_;
623
626 float covalent_radius_;
627
630 float van_der_waals_radius_;
631
634 bool is_metal_;
635
638 float electronegativity_;
639 };
640
641
646 std::ostream& operator << (std::ostream& s, const Element& element);
647
648
652 {
653 public:
654
656
657
660
661
664
667 PTE_(const PTE_& pse);
668
671 virtual ~PTE_();
672
675 virtual void clear();
676
678
681
686 PTE_& operator = (const PTE_& /*pte*/);
687
689
692
695 static Element& getElement(Position atomic_number);
696
700 static Element& getElement(const String& symbol);
701
703
706
711 bool operator == (const PTE_& pte) const;
712
716 Element& operator [] (const String& symbol);
717
721 const Element& operator [] (const String& symbol) const;
722
726 Element& operator [] (Element::Name name);
727
731 const Element& operator [] (Element::Name name) const;
732
736 Element& operator [] (Element::Symbol symbol);
737
741 const Element& operator [] (Element::Symbol symbol) const;
742
746 Element& operator [] (Position position);
747
751 const Element& operator [] (Position position) const;
752
754
757
763 static bool apply(UnaryProcessor<Element>& applicator);
764
766
769 {
771 const char* symbol;
772
775 };
776
777 private:
778
780 static Element element_[];
781
783 static SymbolToElement symbol_to_element_[];
784
786 static Element* atomic_number_to_element_[];
787 };
788
789
793 BALL_EXPORT extern PTE_ PTE;
794
795
796
797# ifndef BALL_NO_INLINE_FUNCTIONS
798# include <BALL/KERNEL/PTE.iC>
799# endif
800} //namespace BALL
801
802
803#endif // BALL_KERNEL_PTE_H
#define BALL_CREATE(name)
Definition: create.h:62
BALL_EXPORT std::ostream & operator<<(std::ostream &os, const Exception::GeneralException &e)
BALL_EXPORT PTE_ PTE
Definition: constants.h:13
BALL_EXPORT bool operator<(const String &s1, const String &s2)
BALL_EXPORT bool operator>(const String &s1, const String &s2)
BALL_EXPORT bool operator==(const String &s1, const String &s2)
BALL_EXPORT bool operator!=(const String &s1, const String &s2)
BALL_EXPORT bool operator>=(const String &s1, const String &s2)
BALL_EXPORT bool operator<=(const String &s1, const String &s2)
short AtomicNumber
Definition: PTE.h:70
@ BARIUM
Definition: PTE.h:84
@ CURIUM
Definition: PTE.h:101
@ GADOLINIUM
Definition: PTE.h:110
@ SELENIUM
Definition: PTE.h:163
@ OXYGEN
Definition: PTE.h:144
@ CERIUM
Definition: PTE.h:96
@ NEODYMIUM
Definition: PTE.h:136
@ RUBIDIUM
Definition: PTE.h:158
@ VANADIUM
Definition: PTE.h:183
@ IODINE
Definition: PTE.h:120
@ NITROGEN
Definition: PTE.h:141
@ ALUMINUM
Definition: PTE.h:78
@ CALIFORNIUM
Definition: PTE.h:94
@ IRIDIUM
Definition: PTE.h:121
@ CHROMIUM
Definition: PTE.h:98
@ PLUTONIUM
Definition: PTE.h:148
@ ASTATINE
Definition: PTE.h:83
@ BERYLLIUM
Definition: PTE.h:86
@ TECHNETIUM
Definition: PTE.h:170
@ BOHRIUM
Definition: PTE.h:88
@ URANIUM
Definition: PTE.h:182
@ POLONIUM
Definition: PTE.h:149
@ RUTHENIUM
Definition: PTE.h:159
@ JOLIOTIUM
Definition: PTE.h:123
@ NOBELIUM
Definition: PTE.h:142
@ CALCIUM
Definition: PTE.h:93
@ PHOSPHORUS
Definition: PTE.h:146
@ LUTETIUM
Definition: PTE.h:129
@ PROTACTINIUM
Definition: PTE.h:153
@ RUTHERFORDIUM
Definition: PTE.h:160
@ UNUNBIUM
Definition: PTE.h:179
@ CARBON
Definition: PTE.h:95
@ PALLADIUM
Definition: PTE.h:145
@ COBALT
Definition: PTE.h:99
@ MEITNERIUM
Definition: PTE.h:132
@ NEPTUNIUM
Definition: PTE.h:138
@ RHENIUM
Definition: PTE.h:156
@ ARSENIC
Definition: PTE.h:82
@ GALLIUM
Definition: PTE.h:111
@ RADIUM
Definition: PTE.h:154
@ NICKEL
Definition: PTE.h:139
@ DYSPROSIUM
Definition: PTE.h:103
@ INDIUM
Definition: PTE.h:119
@ BORON
Definition: PTE.h:89
@ CHLORINE
Definition: PTE.h:97
@ CAESIUM
Definition: PTE.h:92
@ HELIUM
Definition: PTE.h:116
@ NIOBIUM
Definition: PTE.h:140
@ TELLURIUM
Definition: PTE.h:171
@ FERMIUM
Definition: PTE.h:107
@ EUROPIUM
Definition: PTE.h:106
@ TERBIUM
Definition: PTE.h:172
@ YTTRIUM
Definition: PTE.h:186
@ OSMIUM
Definition: PTE.h:143
@ UNUNNILIUM
Definition: PTE.h:180
@ STRONTIUM
Definition: PTE.h:167
@ HAFNIUM
Definition: PTE.h:114
@ TUNGSTEN
Definition: PTE.h:178
@ ARGON
Definition: PTE.h:81
@ ANTIMONY
Definition: PTE.h:80
@ PRASEODYMIUM
Definition: PTE.h:151
@ FRANCIUM
Definition: PTE.h:109
@ PROMETHIUM
Definition: PTE.h:152
@ DUBNIUM
Definition: PTE.h:102
@ THALLIUM
Definition: PTE.h:173
@ UNUNNINIUM
Definition: PTE.h:181
@ PLATINUM
Definition: PTE.h:147
@ COPPER
Definition: PTE.h:100
@ THULIUM
Definition: PTE.h:175
@ AMERICIUM
Definition: PTE.h:79
@ ZIRCONIUM
Definition: PTE.h:188
@ BISMUTH
Definition: PTE.h:87
@ MENDELEVIUM
Definition: PTE.h:133
@ LITHIUM
Definition: PTE.h:128
@ CADMIUM
Definition: PTE.h:91
@ TITANIUM
Definition: PTE.h:177
@ HAHNIUM
Definition: PTE.h:115
@ LAWRENCIUM
Definition: PTE.h:126
@ MOLYBDENUM
Definition: PTE.h:135
@ LANTHANUM
Definition: PTE.h:125
@ HOLMIUM
Definition: PTE.h:117
@ ERBIUM
Definition: PTE.h:105
@ EINSTEINIUM
Definition: PTE.h:104
@ MAGNESIUM
Definition: PTE.h:130
@ HYDROGEN
Definition: PTE.h:118
@ BERKELIUM
Definition: PTE.h:85
@ SCANDIUM
Definition: PTE.h:162
@ TANTALUM
Definition: PTE.h:169
@ YTTERBIUM
Definition: PTE.h:185
@ GERMANIUM
Definition: PTE.h:112
@ RHODIUM
Definition: PTE.h:157
@ SAMARIUM
Definition: PTE.h:161
@ FLUORINE
Definition: PTE.h:108
@ THORIUM
Definition: PTE.h:174
@ KRYPTON
Definition: PTE.h:124
@ BROMINE
Definition: PTE.h:90
void setName(const String &name)
float getAtomicRadius() const
void setAtomicRadius(float atomic_radius)
void setPeriod(Period period)
virtual void clear()
const String & getSymbol() const
void setAtomicWeight(float atomic_weight)
const String & getName() const
AtomicNumber getAtomicNumber() const
void setCovalentRadius(float covalent_radius)
void setGroup(Group group)
void setElectronegativity(float electronegativity)
static Element UNKNOWN
Definition: PTE.h:550
short Group
Definition: PTE.h:62
bool isMetal() const
Period getPeriod() const
Element(const String &name, const String &symbol, Group group, Period period, AtomicNumber atomic_umber, float atomic_weight, float atomic_radius, float covalent_radius, float van_der_waals_radius, bool is_metal, float electronegativity)
float getVanDerWaalsRadius() const
short Period
Definition: PTE.h:66
float getAtomicWeight() const
Element(const Element &element)
Group getGroup() const
virtual ~Element()
void setSymbol(const String &symbol)
float getElectronegativity() const
void setAtomicNumber(AtomicNumber atomic_number)
void setVanDerWaalsRadius(float van_der_waals_radius)
float getCovalentRadius() const
bool isUnknown() const
const char * symbol
Definition: PTE.h:771
#define BALL_EXPORT
Definition: COMMON/global.h:50