Data Structures | Public Member Functions | Static Public Attributes
atomicWeightTable Class Reference

A table of atomic weights for all the elements. More...

Inheritance diagram for atomicWeightTable:
Inheritance graph
[legend]
Collaboration diagram for atomicWeightTable:
Collaboration graph
[legend]

Data Structures

struct  atomicWeight
 Structure to hold the element name and atomic weight pair. More...
 

Public Member Functions

 atomicWeightTable ()
 Construct from atomicWeights_. More...
 
- Public Member Functions inherited from HashTable< scalar >
bool set (const Key &, const T &newElmt)
 Assign a new hashedEntry, overwriting existing entries. More...
 
 HashTable (const label size=128)
 Construct given initial table size. More...
 
 HashTable (Istream &, const label size=128)
 Construct from Istream. More...
 
 HashTable (const HashTable< T, Key, Hash > &)
 Construct as copy. More...
 
 HashTable (const Xfer< HashTable< T, Key, Hash > > &)
 Construct by transferring the parameter contents. More...
 
 ~HashTable ()
 Destructor. More...
 
label capacity () const
 The size of the underlying table. More...
 
label size () const
 Return number of elements in table. More...
 
bool empty () const
 Return true if the hash table is empty. More...
 
bool found (const Key &) const
 Return true if hashedEntry is found in table. More...
 
iterator find (const Key &)
 Find and return an iterator set at the hashedEntry. More...
 
const_iterator find (const Key &) const
 Find and return an const_iterator set at the hashedEntry. More...
 
List< Key > toc () const
 Return the table of contents. More...
 
List< Key > sortedToc () const
 Return the table of contents as a sorted list. More...
 
OstreamprintInfo (Ostream &) const
 Print information. More...
 
bool insert (const Key &, const T &newElmt)
 Insert a new hashedEntry. More...
 
bool erase (const iterator &)
 Erase a hashedEntry specified by given iterator. More...
 
bool erase (const Key &)
 Erase a hashedEntry specified by the given key. More...
 
label erase (const UList< Key > &)
 Remove entries given by the listed keys from this HashTable. More...
 
label erase (const HashTable< AnyType, Key, AnyHash > &)
 Remove entries given by the given keys from this HashTable. More...
 
Foam::label erase (const HashTable< AnyType, Key, AnyHash > &rhs)
 
void resize (const label newSize)
 Resize the hash table for efficiency. More...
 
void clear ()
 Clear all entries from table. More...
 
void clearStorage ()
 Clear the table entries and the table itself. More...
 
void shrink ()
 Shrink the allocated table to approx. twice number of elements. More...
 
void transfer (HashTable< T, Key, Hash > &)
 Transfer the contents of the argument table into this table. More...
 
Xfer< HashTable< T, Key, Hash > > xfer ()
 Transfer contents to the Xfer container. More...
 
Toperator[] (const Key &)
 Find and return a hashedEntry. More...
 
const Toperator[] (const Key &) const
 Find and return a hashedEntry. More...
 
Toperator() (const Key &)
 Find and return a hashedEntry, create it null if not present. More...
 
void operator= (const HashTable< T, Key, Hash > &)
 Assignment. More...
 
bool operator== (const HashTable< T, Key, Hash > &) const
 Equality. Hash tables are equal if the keys and values are equal. More...
 
bool operator!= (const HashTable< T, Key, Hash > &) const
 The opposite of the equality operation. Takes linear time. More...
 
iterator begin ()
 Iterator set to the beginning of the HashTable. More...
 
const_iterator begin () const
 const_iterator set to the beginning of the HashTable More...
 
const_iterator cbegin () const
 const_iterator set to the beginning of the HashTable More...
 

Static Public Attributes

static const int nElements = 104
 
static const atomicWeight atomicWeights [nElements]
 Static table of the weights of all known elements. More...
 

Additional Inherited Members

- Public Types inherited from HashTable< scalar >
typedef T value_type
 Type of values the HashTable contains. More...
 
typedef Treference
 Type that can be used for storing into HashTable::value_type. More...
 
typedef label size_type
 The type that can represent the size of a HashTable. More...
 
- Data Fields inherited from HashTable< scalar >
const typedef Tconst_reference
 Type that can be used for storing into constant. More...
 

Detailed Description

A table of atomic weights for all the elements.

Source files

Definition at line 49 of file atomicWeights.H.

Constructor & Destructor Documentation

◆ atomicWeightTable()

Construct from atomicWeights_.

Definition at line 142 of file atomicWeights.C.

References atomicWeightTable::atomicWeights, HashTable< scalar >::insert(), Foam::name(), and atomicWeightTable::nElements.

Here is the call graph for this function:

Field Documentation

◆ nElements

const int nElements = 104
static

Definition at line 65 of file atomicWeights.H.

Referenced by atomicWeightTable::atomicWeightTable().

◆ atomicWeights

const Foam::atomicWeightTable::atomicWeight atomicWeights
static

Static table of the weights of all known elements.

Definition at line 68 of file atomicWeights.H.

Referenced by atomicWeightTable::atomicWeightTable().


The documentation for this class was generated from the following files: