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
19 # include <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 
35 namespace 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,
120  IODINE, JOD = IODINE,
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 
196  enum Symbol
197  {
198  Ac = 0,
199  Al,
200  Am,
201  Sb,
202  Ar,
203  As,
204  At,
205  Ba,
206  Bk,
207  Be,
208  Bi,
209  Bh,
210  B,
211  Br,
212  Cd,
213  Cs,
214  Ca,
215  Cf,
216  C,
217  Ce,
218  Cl,
219  Cr,
220  Co,
221  Cu,
222  Cm,
223  Db,
224  Dy,
225  Es,
226  Er,
227  Eu,
228  Fm,
229  F,
230  Fr,
231  Gd,
232  Ga,
233  Ge,
234  Au,
235  Hf,
236  Hn,
237  He,
238  Ho,
239  H,
240  In,
241  I,
242  Ir,
243  Fe,
244  Jl,
245  Kr,
246  La,
247  Lr,
248  Pb,
249  Li,
250  Lu,
251  Mg,
252  Mn,
253  Mt,
254  Md,
255  Hg,
256  Mo,
257  Nd,
258  Ne,
259  Np,
260  Ni,
261  Nb,
262  N,
263  No,
264  Os,
265  O,
266  Pd,
267  P,
268  Pt,
269  Pu,
270  Po,
271  K,
272  Pr,
273  Pm,
274  Pa,
275  Ra,
276  Rn,
277  Re,
278  Rh,
279  Rb,
280  Ru,
281  Rf,
282  Sm,
283  Sc,
284  Se,
285  Si,
286  Ag,
287  Na,
288  Sr,
289  S,
290  Ta,
291  Tc,
292  Te,
293  Tb,
294  Tl,
295  Th,
296  Tm,
297  Sn,
298  Ti,
299  W,
303  U,
304  V,
305  Xe,
306  Yb,
307  Y,
308  Zn,
309  Zr
310  };
311 
315 
320  Element();
321 
324  Element(const Element& element);
325 
328  Element
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 
397  Group getGroup() const;
398 
402  void setPeriod(Period period);
403 
407  Period getPeriod() const;
408 
412  void setAtomicNumber(AtomicNumber atomic_number);
413 
417  AtomicNumber getAtomicNumber() const;
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 
550  static Element UNKNOWN;
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 
663  PTE_();
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
BALL::Element::DYSPROSIUM
Definition: PTE.h:103
BALL::Element::MANGANESE
Definition: PTE.h:131
BALL::Element::RHODIUM
Definition: PTE.h:157
BALL::Element::Dy
Definition: PTE.h:224
BALL::Element::Uub
Definition: PTE.h:300
BALL::Element::I
Definition: PTE.h:241
BALL::Element::RUTHERFORDIUM
Definition: PTE.h:160
BALL::Element::Zn
Definition: PTE.h:308
BALL::Element::O
Definition: PTE.h:265
BALL::Element::ASTATINE
Definition: PTE.h:83
BALL::PTE_::SymbolToElement::symbol
const char * symbol
Definition: PTE.h:771
BALL::Element::Sc
Definition: PTE.h:283
BALL::Element::Y
Definition: PTE.h:307
BALL_EXPORT
#define BALL_EXPORT
Definition: COMMON/global.h:50
BALL::Element::Ba
Definition: PTE.h:205
BALL::Element::CALCIUM
Definition: PTE.h:93
BALL::Element::Hg
Definition: PTE.h:255
BALL::Element::SILICON
Definition: PTE.h:164
BALL::Element::BROMINE
Definition: PTE.h:90
BALL::Element::PROMETHIUM
Definition: PTE.h:152
BALL::Element::Sr
Definition: PTE.h:288
BALL::PTE
BALL_EXPORT PTE_ PTE
BALL::Element::Ta
Definition: PTE.h:290
BALL::Element::Re
Definition: PTE.h:277
BALL::Element::Fm
Definition: PTE.h:228
BALL::Element::Os
Definition: PTE.h:264
BALL::Element::GADOLINIUM
Definition: PTE.h:110
BALL::Element::Ti
Definition: PTE.h:298
BALL::Element::Co
Definition: PTE.h:220
BALL::Element::Hn
Definition: PTE.h:236
BALL::Element::Sb
Definition: PTE.h:201
BALL::Element::Mg
Definition: PTE.h:251
BALL::Element::U
Definition: PTE.h:303
BALL::Element::Sn
Definition: PTE.h:297
BALL::Element::TECHNETIUM
Definition: PTE.h:170
BALL::Element::Bk
Definition: PTE.h:206
BALL::Element::As
Definition: PTE.h:203
BALL::operator!=
BALL_EXPORT bool operator!=(const String &s1, const String &s2)
BALL::Element::Pb
Definition: PTE.h:248
BALL::Element::Yb
Definition: PTE.h:306
BALL::Element::BOHRIUM
Definition: PTE.h:88
BALL::Element::Th
Definition: PTE.h:295
BALL::Element::YTTERBIUM
Definition: PTE.h:185
BALL::Element::C
Definition: PTE.h:216
BALL::Element::La
Definition: PTE.h:246
BALL::Element::Ho
Definition: PTE.h:238
BALL::Element::LUTETIUM
Definition: PTE.h:129
BALL::Element::Name
Name
Definition: PTE.h:75
BALL::Element::Tb
Definition: PTE.h:293
BALL::Element::He
Definition: PTE.h:237
BALL::Element::Mt
Definition: PTE.h:253
BALL::Element::CURIUM
Definition: PTE.h:101
BALL::Element::Ge
Definition: PTE.h:233
BALL::Element::ARSENIC
Definition: PTE.h:82
BALL::Element::S
Definition: PTE.h:289
BALL::Element::Ga
Definition: PTE.h:232
BALL::Element::YTTRIUM
Definition: PTE.h:186
create.h
BALL::operator<
BALL_EXPORT bool operator<(const String &s1, const String &s2)
BALL::Element::SAMARIUM
Definition: PTE.h:161
BALL::Element::Lr
Definition: PTE.h:247
BALL::Element::ERBIUM
Definition: PTE.h:105
BALL::Element::UNUNBIUM
Definition: PTE.h:179
BALL::Element::Pt
Definition: PTE.h:268
BALL::Element::SULPHUR
Definition: PTE.h:168
BALL::Element::BERYLLIUM
Definition: PTE.h:86
BALL::Element::Hf
Definition: PTE.h:235
BALL::PTE_::SymbolToElement
Definition: PTE.h:768
BALL::Element::VANADIUM
Definition: PTE.h:183
BALL::Element::PRASEODYMIUM
Definition: PTE.h:151
BALL::Element::BORON
Definition: PTE.h:89
BALL_SIZE_TYPE
BALL::Element::Kr
Definition: PTE.h:245
BALL::Element::Cm
Definition: PTE.h:222
BALL::Element::HAHNIUM
Definition: PTE.h:115
BALL::Element::FERMIUM
Definition: PTE.h:107
BALL::Element::F
Definition: PTE.h:229
BALL::Element::V
Definition: PTE.h:304
BALL::Element::LAWRENCIUM
Definition: PTE.h:126
BALL::Element::Fe
Definition: PTE.h:243
BALL::Element::ARGON
Definition: PTE.h:81
BALL::Element::RUTHENIUM
Definition: PTE.h:159
BALL::Element::JOLIOTIUM
Definition: PTE.h:123
BALL::Element::Ar
Definition: PTE.h:202
BALL::Element::INDIUM
Definition: PTE.h:119
BALL::operator>
BALL_EXPORT bool operator>(const String &s1, const String &s2)
BALL::Element::P
Definition: PTE.h:267
BALL::Element::HELIUM
Definition: PTE.h:116
BALL::Element::Mn
Definition: PTE.h:252
BALL::Element::Ru
Definition: PTE.h:280
BALL::Element::Ag
Definition: PTE.h:286
BALL::Element::NEPTUNIUM
Definition: PTE.h:138
BALL::Element::PHOSPHORUS
Definition: PTE.h:146
BALL::Element::ALUMINUM
Definition: PTE.h:78
BALL::Element::Rf
Definition: PTE.h:281
BALL::operator>=
BALL_EXPORT bool operator>=(const String &s1, const String &s2)
BALL
Definition: constants.h:12
BALL::Element::Ra
Definition: PTE.h:275
BALL::Element::Nb
Definition: PTE.h:261
BALL::Element::Eu
Definition: PTE.h:227
BALL::Element::Symbol
Symbol
Definition: PTE.h:196
BALL::Element::Db
Definition: PTE.h:223
BALL::Element::MOLYBDENUM
Definition: PTE.h:135
BALL::Element::AtomicNumber
short AtomicNumber
Definition: PTE.h:70
BALL::Element::Li
Definition: PTE.h:249
BALL::Element::URANIUM
Definition: PTE.h:182
BALL::Element::POTASSIUM
Definition: PTE.h:150
BALL::String
Definition: string.h:56
BALL::Element::Pm
Definition: PTE.h:273
BALL::Element::TELLURIUM
Definition: PTE.h:171
BALL::Element::Mo
Definition: PTE.h:256
BALL::Element::Cr
Definition: PTE.h:219
BALL::Element::THORIUM
Definition: PTE.h:174
BALL::Element::SCANDIUM
Definition: PTE.h:162
BALL::Element::Cf
Definition: PTE.h:215
BALL::Element::AMERICIUM
Definition: PTE.h:79
BALL::Element::Cu
Definition: PTE.h:221
BALL::Element::KRYPTON
Definition: PTE.h:124
BALL::Element::BARIUM
Definition: PTE.h:84
BALL::Element::Gd
Definition: PTE.h:231
BALL::Element::Rb
Definition: PTE.h:279
BALL::Element::IRIDIUM
Definition: PTE.h:121
BALL::Element::NIOBIUM
Definition: PTE.h:140
BALL::Element::CADMIUM
Definition: PTE.h:91
BALL::Element::NEODYMIUM
Definition: PTE.h:136
BALL::Element::THALLIUM
Definition: PTE.h:173
BALL::Element::NOBELIUM
Definition: PTE.h:142
BALL::Element::HAFNIUM
Definition: PTE.h:114
BALL::Element::MENDELEVIUM
Definition: PTE.h:133
BALL::Element::Tm
Definition: PTE.h:296
BALL::Element::Pr
Definition: PTE.h:272
BALL::Element::FRANCIUM
Definition: PTE.h:109
BALL::Element::Tl
Definition: PTE.h:294
BALL::Element::POLONIUM
Definition: PTE.h:149
BALL::Element::K
Definition: PTE.h:271
BALL::Element::Md
Definition: PTE.h:254
BALL::Element::Na
Definition: PTE.h:287
BALL::Element::XENON
Definition: PTE.h:184
BALL::Element::CERIUM
Definition: PTE.h:96
BALL::Element::SODIUM
Definition: PTE.h:166
BALL::Element::Cl
Definition: PTE.h:218
BALL::Element::SELENIUM
Definition: PTE.h:163
BALL::Element::Es
Definition: PTE.h:225
BALL::Element::Bh
Definition: PTE.h:209
BALL::Element::BERKELIUM
Definition: PTE.h:85
BALL::Element::Si
Definition: PTE.h:285
BALL::Element::STRONTIUM
Definition: PTE.h:167
BALL::Element::PLATINUM
Definition: PTE.h:147
BALL::Element::SILVER
Definition: PTE.h:165
BALL::Element::OSMIUM
Definition: PTE.h:143
BALL::Element
Definition: PTE.h:54
BALL::Element::Bi
Definition: PTE.h:208
BALL::Element::Er
Definition: PTE.h:226
BALL::Element::GERMANIUM
Definition: PTE.h:112
BALL::Element::CAESIUM
Definition: PTE.h:92
BALL::Element::CHLORINE
Definition: PTE.h:97
BALL::Element::TITANIUM
Definition: PTE.h:177
BALL::Element::RHENIUM
Definition: PTE.h:156
BALL::Element::ZIRCONIUM
Definition: PTE.h:188
BALL::Element::N
Definition: PTE.h:262
BALL::Element::B
Definition: PTE.h:210
BALL::Element::LITHIUM
Definition: PTE.h:128
BALL::Element::RUBIDIUM
Definition: PTE.h:158
BALL::Element::Uun
Definition: PTE.h:301
BALL::Element::UNUNNINIUM
Definition: PTE.h:181
BALL::Element::MAGNESIUM
Definition: PTE.h:130
BALL::Element::PLUTONIUM
Definition: PTE.h:148
BALL::Element::Ir
Definition: PTE.h:242
BALL::Element::GALLIUM
Definition: PTE.h:111
BALL::Element::Xe
Definition: PTE.h:305
string.h
BALL::Element::Ce
Definition: PTE.h:217
processor.h
BALL::Element::Jl
Definition: PTE.h:244
BALL::Element::HOLMIUM
Definition: PTE.h:117
BALL::Element::FLUORINE
Definition: PTE.h:108
BALL::Element::TIN
Definition: PTE.h:176
BALL::Element::DUBNIUM
Definition: PTE.h:102
BALL::Element::At
Definition: PTE.h:204
BALL::Element::Fr
Definition: PTE.h:230
BALL::UnaryProcessor
Definition: processor.h:58
BALL::Element::Pd
Definition: PTE.h:266
BALL::Element::LANTHANUM
Definition: PTE.h:125
BALL::operator==
BALL_EXPORT bool operator==(const String &s1, const String &s2)
BALL::Element::EINSTEINIUM
Definition: PTE.h:104
BALL::Element::NICKEL
Definition: PTE.h:139
BALL::Element::Ne
Definition: PTE.h:258
BALL::Element::Ca
Definition: PTE.h:214
BALL::Element::THULIUM
Definition: PTE.h:175
BALL::Element::Np
Definition: PTE.h:259
BALL::Element::Group
short Group
Definition: PTE.h:62
BALL::Element::MERCURY
Definition: PTE.h:134
BALL::operator<<
BALL_EXPORT std::ostream & operator<<(std::ostream &os, const Exception::GeneralException &e)
BALL::Element::Nd
Definition: PTE.h:257
BALL::Element::UNUNNILIUM
Definition: PTE.h:180
BALL::Element::Tc
Definition: PTE.h:291
BALL::Element::EUROPIUM
Definition: PTE.h:106
BALL::PTE_::SymbolToElement::element
Element * element
Definition: PTE.h:774
BALL::Element::Se
Definition: PTE.h:284
BALL::Element::UNKNOWN
static Element UNKNOWN
Definition: PTE.h:550
BALL::Element::NEON
Definition: PTE.h:137
BALL::Element::TERBIUM
Definition: PTE.h:172
BALL::PTE_
Definition: PTE.h:651
BALL::Element::COBALT
Definition: PTE.h:99
BALL::Element::PROTACTINIUM
Definition: PTE.h:153
BALL::Element::In
Definition: PTE.h:240
BALL_CREATE
#define BALL_CREATE(name)
Definition: create.h:62
BALL::Element::Rn
Definition: PTE.h:276
BALL::Element::Sm
Definition: PTE.h:282
BALL::Element::Am
Definition: PTE.h:200
BALL::Element::Br
Definition: PTE.h:211
BALL::Element::Rh
Definition: PTE.h:278
BALL::Element::Be
Definition: PTE.h:207
BALL::operator<=
BALL_EXPORT bool operator<=(const String &s1, const String &s2)
BALL::Element::No
Definition: PTE.h:263
BALL::Element::RADIUM
Definition: PTE.h:154
BALL::Element::GOLD
Definition: PTE.h:113
BALL::RTTI::getName
const char * getName()
Definition: rtti.h:97
BALL::Element::Uuu
Definition: PTE.h:302
BALL::Element::Pu
Definition: PTE.h:269
BALL::Element::Pa
Definition: PTE.h:274
BALL::Element::Po
Definition: PTE.h:270
BALL::Element::Al
Definition: PTE.h:199
BALL::Element::Period
short Period
Definition: PTE.h:66
BALL::Element::PALLADIUM
Definition: PTE.h:145
BALL::Element::Au
Definition: PTE.h:234
BALL::Element::Ni
Definition: PTE.h:260
BALL::Element::Cs
Definition: PTE.h:213
BALL::Element::MEITNERIUM
Definition: PTE.h:132
BALL::Element::W
Definition: PTE.h:299
BALL::Element::RADON
Definition: PTE.h:155
BALL::Element::TANTALUM
Definition: PTE.h:169
BALL::Element::CALIFORNIUM
Definition: PTE.h:94
BALL::Element::H
Definition: PTE.h:239
BALL::Element::Te
Definition: PTE.h:292
BALL::Element::Cd
Definition: PTE.h:212
BALL::Element::CHROMIUM
Definition: PTE.h:98
BALL::Element::Lu
Definition: PTE.h:250
BALL::Element::IRON
Definition: PTE.h:122