Garfield++ v2r0
A toolkit for the detailed simulation of particle detectors based on ionisation measurement in gases and semiconductors
|
#include <AtomDef.h>
Public Member Functions | |
AtomDef () | |
Default constructor. | |
AtomDef (const std::string &fnameh, const std::string &fnotationh, int fZh, double fAh) | |
Constructor. | |
~AtomDef () | |
Destructor. | |
const std::string & | name () const |
const std::string & | notation () const |
int | Z () const |
double | A () const |
void | verify () |
Check that there is no atom with the same name in the container. | |
void | print (std::ostream &file, int l=0) const |
virtual AtomDef * | copy () const |
Public Member Functions inherited from Heed::RegPassivePtr | |
RegPassivePtr (void) | |
RegPassivePtr (char fs_ban_del, char fs_ban_sub, char fs_ban_cop=0) | |
RegPassivePtr (const RegPassivePtr &f) | |
RegPassivePtr & | operator= (const RegPassivePtr &f) |
CountPP_ns::CountPassivePtr * | book (void) const |
void | clear_pointers (void) const |
virtual RegPassivePtr * | copy () const |
virtual | ~RegPassivePtr () |
virtual void | print (std::ostream &file, int l=1) const |
void | set_s_ban_del (char fs_ban_del) |
char | get_s_ban_del (void) const |
void | set_s_ban_sub (char fs_ban_sub) |
char | get_s_ban_sub (void) const |
void | set_s_ban_cop (char fs_ban_cop) |
char | get_s_ban_cop (void) const |
void | set_s_allow_del_at_zero_count (char fs_allow_del_at_zero_count) |
char | get_s_allow_del_at_zero_count (void) const |
long | get_total_number_of_references (void) const |
Static Public Member Functions | |
static void | printall (std::ostream &file) |
Print all registered atoms. | |
static std::list< AtomDef * > & | get_logbook () |
static const std::list< AtomDef * > & | get_const_logbook () |
static AtomDef * | get_AtomDef (const std::string &fnotation) |
static double | get_A (int fZ) |
static AtomDef * | get_AtomDef (int fZ) |
Static Public Member Functions inherited from Heed::RegPassivePtr | |
static void | set_s_ban_del_ignore (char fs_ban_del_ignore) |
static char | get_s_ban_del_ignore (void) |
static void | set_s_print_adr_cpp (char fs_print_adr_cpp) |
static char | get_s_print_adr_cpp (void) |
Definition of atoms. Only the basic information: name, notation, atomic weight and charge.
The principle of definitions of atoms is dictionary or a database: the atoms are not repeated, each atom is presented in the total system no more than one time. The system knows each atom presented in it. The atom characteristics can be obtained by literal notation. The system declines the secondary initialization. The copying is not declined. When the user program wants to refer to atom, it has to use either char* (string) notation, or pointer (or reference) to one of these objects. As usually, in the case of pointers I recommend to use protected pointers to external objects PassivePtr. The user pogram can initialize the new atoms. The standard atoms are initiated in files GasLib.h and GasLib.c.
In principle I am going to initiate all atoms from Mendeleev's table, but I haven't finished yet. Only its first half is filled at the moment.
The atoms are registered in the static element of class AtomDef private: static std::list<AtomDef*> logbook; The can be obtained by notations by: public: static const std::list<AtomDef*>& get_AtomDefLogbook(); static AtomDef* get_AtomDef(const std::string& fnotation); returns the address of atom with this name if it is registered in system, or NULL otherwise.
In these files and in the other components of the matter package the principles are similar. This is the principle of database, the principle of the strict protection of internal data (variables marked by suffix 'h') and granting access though the functions which have similar names without this suffix 'h'.
1998-2004, I. Smirnov.
Heed::AtomDef::AtomDef | ( | ) |
Default constructor.
Definition at line 26 of file AtomDef.cpp.
Referenced by copy().
Heed::AtomDef::AtomDef | ( | const std::string & | fnameh, |
const std::string & | fnotationh, | ||
int | fZh, | ||
double | fAh | ||
) |
Constructor.
Definition at line 30 of file AtomDef.cpp.
Heed::AtomDef::~AtomDef | ( | ) |
|
inline |
|
inlinevirtual |
|
static |
Return the atomic number corresponding to a given Z. If the atom is not registered, the current version terminates the program through spexit(). Be careful!
Definition at line 39 of file AtomDef.cpp.
|
static |
Return the address of atom with this name if it is registered in system, or NULL otherwise
Definition at line 100 of file AtomDef.cpp.
Referenced by Heed::AtomMixDef::AtomMixDef().
|
static |
Return the address of atom corresponding to a given Z. If the atom is not registered, the current version terminates the program through spexit(). Be careful!
Definition at line 53 of file AtomDef.cpp.
|
static |
Definition at line 96 of file AtomDef.cpp.
|
static |
Initialize the logbook at the first request and keep it as internal static variable.
Definition at line 91 of file AtomDef.cpp.
Referenced by AtomDef(), get_A(), get_AtomDef(), get_const_logbook(), printall(), verify(), and ~AtomDef().
|
inline |
|
inline |
|
virtual |
Reimplemented from Heed::RegPassivePtr.
Definition at line 14 of file AtomDef.cpp.
|
static |
Print all registered atoms.
Definition at line 18 of file AtomDef.cpp.
void Heed::AtomDef::verify | ( | ) |
Check that there is no atom with the same name in the container.
Definition at line 67 of file AtomDef.cpp.
Referenced by AtomDef().
|
inline |