/usr/include/BALL/KERNEL/PTE.h is in libball1.4-dev 1.4.3~beta1-3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444 445 446 447 448 449 450 451 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 582 583 584 585 586 587 588 589 590 591 592 593 594 595 596 597 598 599 600 601 602 603 604 605 606 607 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 | // -*- Mode: C++; tab-width: 2; -*-
// vi: set ts=2:
//
// $Id: PTE.h,v 1.30.16.1 2007/03/25 21:23:42 oliver Exp $
//
#ifndef BALL_KERNEL_PTE_H
#define BALL_KERNEL_PTE_H
#ifndef BALL_COMMON_CREATE_H
# include <BALL/COMMON/create.h>
#endif
#ifndef BALL_DATATYPE_STRING_H
# include <BALL/DATATYPE/string.h>
#endif
#ifndef BALL_CONCEPT_PROCESSOR_H
# include <BALL/CONCEPT/processor.h>
#endif
#define BALL_ELEMENT_NAME_DEFAULT "Unknown"
#define BALL_ELEMENT_SYMBOL_DEFAULT "?"
#define BALL_ELEMENT_GROUP_DEFAULT 0
#define BALL_ELEMENT_PERIOD_DEFAULT 0
#define BALL_ELEMENT_ATOMICNUMBER_DEFAULT 0
#define BALL_ELEMENT_ATOMICWEIGHT_DEFAULT 0
#define BALL_ELEMENT_ATOMICRADIUS_DEFAULT 0
#define BALL_ELEMENT_COVALENTRADIUS_DEFAULT 0
#define BALL_ELEMENT_VANDERWAALSRADIUS_DEFAULT 0
#define BALL_ELEMENT_ELECTRONEGATIVITY_DEFAULT 0
#define BALL_ELEMENT_IS_METAL_DEFAULT false
namespace BALL
{
/** \defgroup PTE Periodic Table of Elements
These classes represent elements and the periodic table of elements.
The \link Element Element \endlink class is used to describe common properties of atoms
(e.g., mass, nuclear charge, element symbol). Elements can be retrieved
from the \link PTE PTE \endlink object (<b>P</b>eriodic <b>T</b>able of <b>E</b>lements)
which is a global instance of \link PTE_ PTE_ \endlink . \par
@see Atom::setElement
@see Atom::getElement
\ingroup KernelMiscellaneous
*/
//@{
/** Element class.
\ingroup KernelMiscellaneous
*/
class BALL_EXPORT Element
{
public:
BALL_CREATE(Element)
/** Group
*/
typedef short Group;
/** Period
*/
typedef short Period;
/** AtomicNumber
*/
typedef short AtomicNumber;
/** Name
Element names.
*/
enum Name
{
ACTINIUM = 0,
ALUMINUM,
AMERICIUM,
ANTIMONY, STIBIUM = ANTIMONY,
ARGON,
ARSENIC,
ASTATINE,
BARIUM,
BERKELIUM,
BERYLLIUM,
BISMUTH, WISMUT = BISMUTH,
BOHRIUM,
BORON,
BROMINE,
CADMIUM,
CAESIUM,
CALCIUM,
CALIFORNIUM,
CARBON, CARBONEUM = CARBON,
CERIUM,
CHLORINE,
CHROMIUM,
COBALT,
COPPER, CUPRUM = COPPER,
CURIUM,
DUBNIUM,
DYSPROSIUM,
EINSTEINIUM,
ERBIUM,
EUROPIUM,
FERMIUM,
FLUORINE,
FRANCIUM,
GADOLINIUM,
GALLIUM,
GERMANIUM,
GOLD, AURUM = GOLD,
HAFNIUM,
HAHNIUM,
HELIUM,
HOLMIUM,
HYDROGEN, HYDROGENIUM = HYDROGEN,
INDIUM,
IODINE, JOD = IODINE,
IRIDIUM,
IRON, FERRUM = IRON,
JOLIOTIUM,
KRYPTON,
LANTHANUM,
LAWRENCIUM,
LEAD, PLUMBUM = LEAD,
LITHIUM,
LUTETIUM,
MAGNESIUM,
MANGANESE, MANGAN = MANGANESE,
MEITNERIUM,
MENDELEVIUM,
MERCURY, HYDRARGYRUM = MERCURY, MERCURIUM = MERCURY,
MOLYBDENUM,
NEODYMIUM,
NEON,
NEPTUNIUM,
NICKEL,
NIOBIUM,
NITROGEN, NITROGENIUM = NITROGEN,
NOBELIUM,
OSMIUM,
OXYGEN, OXYGENIUM = OXYGEN,
PALLADIUM,
PHOSPHORUS,
PLATINUM,
PLUTONIUM,
POLONIUM,
POTASSIUM, KALIUM = POTASSIUM,
PRASEODYMIUM,
PROMETHIUM,
PROTACTINIUM,
RADIUM,
RADON,
RHENIUM,
RHODIUM,
RUBIDIUM,
RUTHENIUM,
RUTHERFORDIUM,
SAMARIUM,
SCANDIUM,
SELENIUM,
SILICON, SILICIUM = SILICON,
SILVER, ARGENTUM = SILVER,
SODIUM, NATRIUM = SODIUM,
STRONTIUM,
SULPHUR, SULFUR = SULPHUR,
TANTALUM,
TECHNETIUM,
TELLURIUM,
TERBIUM,
THALLIUM,
THORIUM,
THULIUM,
TIN, STANNUM = TIN,
TITANIUM,
TUNGSTEN, WOLFRAM = TUNGSTEN,
UNUNBIUM,
UNUNNILIUM,
UNUNNINIUM,
URANIUM,
VANADIUM,
XENON,
YTTERBIUM,
YTTRIUM,
ZINC, ZINCUM = ZINC,
ZIRCONIUM,
NUMBER_OF_ELEMENTS // 111
};
/** @name Symbol
Element symbols.
*/
enum Symbol
{
Ac = 0,
Al,
Am,
Sb,
Ar,
As,
At,
Ba,
Bk,
Be,
Bi,
Bh,
B,
Br,
Cd,
Cs,
Ca,
Cf,
C,
Ce,
Cl,
Cr,
Co,
Cu,
Cm,
Db,
Dy,
Es,
Er,
Eu,
Fm,
F,
Fr,
Gd,
Ga,
Ge,
Au,
Hf,
Hn,
He,
Ho,
H,
In,
I,
Ir,
Fe,
Jl,
Kr,
La,
Lr,
Pb,
Li,
Lu,
Mg,
Mn,
Mt,
Md,
Hg,
Mo,
Nd,
Ne,
Np,
Ni,
Nb,
N,
No,
Os,
O,
Pd,
P,
Pt,
Pu,
Po,
K,
Pr,
Pm,
Pa,
Ra,
Rn,
Re,
Rh,
Rb,
Ru,
Rf,
Sm,
Sc,
Se,
Si,
Ag,
Na,
Sr,
S,
Ta,
Tc,
Te,
Tb,
Tl,
Th,
Tm,
Sn,
Ti,
W,
Uub,
Uun,
Uuu,
U,
V,
Xe,
Yb,
Y,
Zn,
Zr
};
/** @name Constructors and Destructors.
*/
//@{
/** Default constructor
The instance is set to the default values
(= \link UNKNOWN UNKNOWN \endlink element).
*/
Element();
/** Constructor
*/
Element(const Element& element);
/** Detailed constructor
*/
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);
/** Destructor
*/
virtual ~Element();
/** Clear method.
The instance is set to the default values
(= \link UNKNOWN UNKNOWN \endlink element).
*/
virtual void clear();
//@}
/** @name Assignment
*/
//@{
/** Assignment operator.
@param element the Element to be copied (cloned)
@return Element& - this instance
*/
Element& operator = (const Element& element);
//@}
/** @name Inspectors and Mutators
*/
//@{
/** Set the name.
@param name the new name
*/
void setName(const String& name);
/**
* Get the name.
* @return The name of the element. For example if the Element is a hydrogen
* the string "Hydrogen" is returned.
*/
const String& getName() const;
/** Set the atomic symbol.
@param symbol the new symbol
*/
void setSymbol(const String& symbol);
/** Get the atomic symbol.
@return String the symbol
*/
const String& getSymbol() const;
/** Set the atomic group.
@param group (short) the new group
*/
void setGroup(Group group);
/** Get the atomic group.
@return Group (short) - the group
*/
Group getGroup() const;
/** Set the atomic period.
@param period (short) the new period
*/
void setPeriod(Period period);
/** Get the atomic period.
@return Period (short) the period
*/
Period getPeriod() const;
/** Set the atomic number.
@param atomic_number the new atomic number
*/
void setAtomicNumber(AtomicNumber atomic_number);
/** Get the atomic number.
@return AtomicNumber (short) - the atomic number
*/
AtomicNumber getAtomicNumber() const;
/** Set the atomic weight.
@param atomic_weight the new atomic weight
*/
void setAtomicWeight(float atomic_weight);
/** Get the atomic weight.
@return float - the atomic weight
*/
float getAtomicWeight() const;
/** Set the atomic radius.
@param atomic_radius the new atomic radius (in Angstrom)
*/
void setAtomicRadius(float atomic_radius);
/** Get the atomic radius.
@return float the atomic radius (in Angstrom)
*/
float getAtomicRadius() const;
/** Set the covalent radius.
@param covalent_radius the new covalent radius (in Angstrom)
*/
void setCovalentRadius(float covalent_radius);
/** Get the covalent radius.
@return float the covalent radius (in Angstrom)
*/
float getCovalentRadius() const;
/** Set the VanDerWaals radius.
@param van_der_waals_radius the new VanDerWaals radius (in Angstrom)
*/
void setVanDerWaalsRadius(float van_der_waals_radius);
/** Get the VanDerWaals radius.
@return float the VanDerWaals radius (in Angstrom)
*/
float getVanDerWaalsRadius() const;
/** Set the electronegativity.
@param electronegativity the new electronegativity (according to the Pauling scale)
*/
void setElectronegativity(float electronegativity);
/** Get the electronegativity.
@return float the electronegativity (according to the Pauling scale)
*/
float getElectronegativity() const;
//@}
/** @name Operators
*/
//@{
/** Equality operator.
Tests if the atomic number of two elements are equal.
@param element the Element to compare with
@return bool
*/
bool operator == (const Element& element) const;
/** Inequality operator.
Tests if the atomic number of two elements are inequal.
@param element the Element to compare with
@return bool
*/
bool operator != (const Element& element) const;
/** Less operator.
Tests if the atomic number of this instance is less
compared with <b> element </b>.
@param element the Element to compare with
@return bool
*/
bool operator < (const Element& element) const;
/** Less or equal operator.
Tests if the atomic number of this instance is less
or equal compared with <b> element </b>.
@param element, the Element to compare with
@return bool
*/
bool operator <= (const Element& element) const;
/** Greater or equal operator.
Tests if the atomic number of this instance is greater
or equal compared with <b> element </b>.
@param element the Element to compare with
@return bool
*/
bool operator >= (const Element& element) const;
/** Greater operator.
Tests if the atomic number of this instance is greater
than <b> element </b>.
@param element the Element to compare with
@return bool
*/
bool operator >(const Element& element) const;
/** Output operator
Prints <b> this </b> instance of Element.
*/
BALL_EXPORT
friend std::ostream& operator << (std::ostream& s, const Element& element);
//@}
/** @name Predicates
*/
//@{
/** Test if this instance is unknown.
Returns true if instance is equal the static Element UNKNOWN
(The default constructor returns such an element).
@return bool
*/
bool isUnknown() const;
/**
* Test if the Element is a metal.
*
* @return true if the Element represents a metal.
*/
bool isMetal() const;
//@}
/** Standard element.
(The default constructor returns such an element).
*/
static Element UNKNOWN;
private:
/** the name of the element
*/
String name_;
/** the uppercased symbol of the element
*/
String symbol_;
/** The group number is an identifier used to describe the
column of the standard periodic table in which the
element appears.
NOTES:
There is considerable confusion surrounding the Group
labels. The scheme used in WebElements is numeric and
is the current IUPAC convention. The other two systems
are less desirable since they are confusing, but still
in common usage. The designations A and B are completely
arbitrary. The first of these (A left, B right) is based
upon older IUPAC recommendations and frequently used in
Europe. The last set (main group elements A, transition
elements B) was in common use in America.
IUPAC, European, and American Group labelling schemes
Group European American
1 IA IA
2 IIA IIA
3 IIIA IIIB
4 IVA IVB
5 VA VB
6 VIA VIB
7 VIIA VIIB
8 VIIIA VIIIB
9 VIIIA VIIIB
10 VIIIA VIIIB
11 IB IB
12 IIB IIB
13 IIIB IIIA
14 IVB IVA
15 VB VA
16 VIB VIA
17 VIIB VIIA
18 VIIIB VIIIA
*/
Group group_;
/** the period of the element
*/
Period period_;
/** The atomic number corresponds to the number of protons
in the nucleus of an atom of that element.
*/
AtomicNumber atomic_number_;
/** The atomic weight of an element (resp. of its most stabile
isotope) is the ratio of the mass of one mole of the
element in a defined source to 1/12 of the mass of
chemically unbound C-12 in its nuclear and electronic
ground state. Adapted from the 1993 report of the IUPAC
Commission on Atomic Weights and Isotopic Abundances
*/
float atomic_weight_;
/** atomic radius (in Angstrom)
*/
float atomic_radius_;
/** covalent radius (in Angstrom)
*/
float covalent_radius_;
/** van der Waals radius (in Angstrom)
*/
float van_der_waals_radius_;
/** is the element a metal
*/
bool is_metal_;
/** electronegativity (according to the Pauling scale)
*/
float electronegativity_;
};
/** Element output operator.
Prints the contents of an instance of \link Element Element \endlink to an <tt>ostream</tt>.
*/
BALL_EXPORT
std::ostream& operator << (std::ostream& s, const Element& element);
/** Periodic Table of Elements Class
*/
class BALL_EXPORT PTE_
{
public:
BALL_CREATE(PTE_)
/** @name Constructors and Destructors
*/
//@{
/** Default constructor
*/
PTE_();
/** Default constructor
*/
PTE_(const PTE_& pse);
/** Destructor
*/
virtual ~PTE_();
/** Clear method.
*/
virtual void clear();
//@}
/** @name Assignment
*/
//@{
/** Assignment operator
Does not assign anything.
Implemented just for the OCI.
*/
PTE_& operator = (const PTE_& /*pte*/);
//@}
/** @name Accessors
*/
//@{
/** Return the element that has the specified atomic number.
*/
static Element& getElement(Position atomic_number);
/** Return the element with a given symbol.
@return Element the static Element with the symbol <b> symbol </b>
*/
static Element& getElement(const String& symbol);
//@}
/** @name Operators
*/
//@{
/** Equality operator.
Always returns true.
Implemented just for the OCI.
*/
bool operator == (const PTE_& pte) const;
/** Access operator with a given symbol.
@return Element the Element with the symbol <b> symbol </b>
*/
Element& operator [] (const String& symbol);
/** Access operator with a given symbol.
@return Element the const Element with the symbol <b> symbol </b>
*/
const Element& operator [] (const String& symbol) const;
/** Access operator with a given name.
@return Element the Element with the name <b> name </b>
*/
Element& operator [] (Element::Name name);
/** Access operator with a given name.
@return Element the const Element with the name <b> name </b>
*/
const Element& operator [] (Element::Name name) const;
/** Access operator with a given Element::Symbol.
@return Element the Element with the symbol <b> symbol </b>
*/
Element& operator [] (Element::Symbol symbol);
/** Access operator with a given Element::Symbol.
@return Element the const Element with the symbol <b> symbol </b>
*/
const Element& operator [] (Element::Symbol symbol) const;
/** Access operator with a given position.
@return Element the Element with the position <b> position </b>
*/
Element& operator [] (Position position);
/** Access operator with a given position.
@return Element the const Element with the position <b> position </b>
*/
const Element& operator [] (Position position) const;
//@}
/** @name Application methods
*/
//@{
/** Application of an unary processor on every contained element.
@param processor a typed unary processor for Element instances
@return bool - <tt>true</tt> if application has been terminated successfully,
<tt>false</tt> otherwise
*/
static bool apply(UnaryProcessor<Element>& applicator);
//@}
///
struct SymbolToElement
{
///
const char* symbol;
///
Element* element;
};
private:
///
static Element element_[];
///
static SymbolToElement symbol_to_element_[];
///
static Element* atomic_number_to_element_[];
};
/** Global static instance of the periodic table.
\ingroup KernelMiscellaneous
*/
BALL_EXPORT extern PTE_ PTE;
# ifndef BALL_NO_INLINE_FUNCTIONS
# include <BALL/KERNEL/PTE.iC>
# endif
} //namespace BALL
#endif // BALL_KERNEL_PTE_H
|