BALL 1.5.0
Loading...
Searching...
No Matches
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
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
@ GADOLINIUM
Definition PTE.h:110
@ NEODYMIUM
Definition PTE.h:136
@ ALUMINUM
Definition PTE.h:78
@ CALIFORNIUM
Definition PTE.h:94
@ 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
@ RUTHENIUM
Definition PTE.h:159
@ JOLIOTIUM
Definition PTE.h:123
@ CALCIUM
Definition PTE.h:93
@ PHOSPHORUS
Definition PTE.h:146
@ PROTACTINIUM
Definition PTE.h:153
@ RUTHERFORDIUM
Definition PTE.h:160
@ PALLADIUM
Definition PTE.h:145
@ MEITNERIUM
Definition PTE.h:132
@ NEPTUNIUM
Definition PTE.h:138
@ ARSENIC
Definition PTE.h:82
@ DYSPROSIUM
Definition PTE.h:103
@ CHLORINE
Definition PTE.h:97
@ CAESIUM
Definition PTE.h:92
@ TELLURIUM
Definition PTE.h:171
@ UNUNNILIUM
Definition PTE.h:180
@ STRONTIUM
Definition PTE.h:167
@ ANTIMONY
Definition PTE.h:80
@ PRASEODYMIUM
Definition PTE.h:151
@ PROMETHIUM
Definition PTE.h:152
@ UNUNNINIUM
Definition PTE.h:181
@ AMERICIUM
Definition PTE.h:79
@ ZIRCONIUM
Definition PTE.h:188
@ BISMUTH
Definition PTE.h:87
@ MENDELEVIUM
Definition PTE.h:133
@ CADMIUM
Definition PTE.h:91
@ LAWRENCIUM
Definition PTE.h:126
@ MOLYBDENUM
Definition PTE.h:135
@ LANTHANUM
Definition PTE.h:125
@ EINSTEINIUM
Definition PTE.h:104
@ MAGNESIUM
Definition PTE.h:130
@ BERKELIUM
Definition PTE.h:85
@ YTTERBIUM
Definition PTE.h:185
@ GERMANIUM
Definition PTE.h:112
@ 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
short Group
Definition PTE.h:62
AtomicNumber getAtomicNumber() const
void setCovalentRadius(float covalent_radius)
void setGroup(Group group)
void setElectronegativity(float electronegativity)
static Element UNKNOWN
Definition PTE.h:550
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
float getAtomicWeight() const
Element(const Element &element)
Group getGroup() const
virtual ~Element()
void setSymbol(const String &symbol)
short Period
Definition PTE.h:66
float getElectronegativity() const
void setAtomicNumber(AtomicNumber atomic_number)
void setVanDerWaalsRadius(float van_der_waals_radius)
short AtomicNumber
Definition PTE.h:70
float getCovalentRadius() const
bool isUnknown() const
const char * symbol
Definition PTE.h:771
#define BALL_EXPORT