The periodic table of elements.
More...
#include <nuri/core/element.h>
|
| static const PeriodicTable & | get () noexcept |
| | Get the singleton instance of the periodic table.
|
| static constexpr bool | has_element (int atomic_number) noexcept |
| | Check if the periodic table has an element with the given atomic symbol.
|
The periodic table of elements.
- Note
- You'd never want to create an instance of this class. Instead, use the get() function to access the singleton instance.
◆ PeriodicTable() [1/2]
| nuri::PeriodicTable::PeriodicTable |
( |
const PeriodicTable & | | ) |
|
|
delete |
◆ PeriodicTable() [2/2]
| nuri::PeriodicTable::PeriodicTable |
( |
PeriodicTable && | | ) |
|
|
deletenoexcept |
◆ ~PeriodicTable()
| nuri::PeriodicTable::~PeriodicTable |
( |
| ) |
|
|
defaultnoexcept |
◆ begin()
| const Element * nuri::PeriodicTable::begin |
( |
| ) |
const |
|
inlinenoexcept |
◆ end()
| const Element * nuri::PeriodicTable::end |
( |
| ) |
const |
|
inlinenoexcept |
◆ find_element() [1/2]
| const Element * nuri::PeriodicTable::find_element |
( |
int | atomic_number | ) |
const |
|
inlineconstexprnoexcept |
Find element with the given atomic number.
- Parameters
-
| atomic_number | The atomic number of the element. |
- Returns
- A pointer to the element, or nullptr if no element with the given atomic number is known.
◆ find_element() [2/2]
| const Element * nuri::PeriodicTable::find_element |
( |
std::string_view | symbol | ) |
const |
|
noexcept |
Find element with the given atomic symbol.
- Parameters
-
| symbol | The atomic symbol of the element. |
- Returns
- A pointer to the element, or nullptr if no element with the given symbol is known.
- Note
- The symbol is case-sensitive, but supports three common cases: Titlecase, UPPERCASE, and lowercase.
◆ find_element_of_name()
| const Element * nuri::PeriodicTable::find_element_of_name |
( |
std::string_view | name | ) |
const |
|
noexcept |
Find element with the given name.
- Parameters
-
| name | The atomic name of the element. |
- Returns
- A pointer to the element, or nullptr if no element with the given name is known.
- Note
- The name is case-sensitive, but supports three common cases: Titlecase, UPPERCASE, and lowercase.
◆ get()
Get the singleton instance of the periodic table.
- Returns
- const PeriodicTable & The singleton instance of the periodic table.
◆ has_element() [1/2]
| constexpr bool nuri::PeriodicTable::has_element |
( |
int | atomic_number | ) |
|
|
inlinestaticconstexprnoexcept |
Check if the periodic table has an element with the given atomic symbol.
- Parameters
-
| atomic_number | The atomic number of the element. |
- Returns
- Whether the periodic table has an element with the given atomic number.
◆ has_element() [2/2]
| bool nuri::PeriodicTable::has_element |
( |
std::string_view | symbol | ) |
const |
|
noexcept |
Check if the periodic table has an element with the given atomic symbol.
- Parameters
-
| symbol | The atomic symbol of the element. |
- Returns
- Whether the periodic table has an element with the given symbol.
- Note
- The symbol is case-sensitive, but supports three common cases: Titlecase, UPPERCASE, and lowercase.
◆ has_element_of_name()
| bool nuri::PeriodicTable::has_element_of_name |
( |
std::string_view | name | ) |
const |
|
noexcept |
Check if the periodic table has an element with the given atomic name.
- Parameters
-
| name | The atomic name of the element. |
- Returns
- Whether the periodic table has an element with the given name.
- Note
- The name is case-sensitive, but supports three common cases: Titlecase, UPPERCASE, and lowercase.
◆ operator=() [1/2]
◆ operator=() [2/2]
◆ operator[]()
| const Element & nuri::PeriodicTable::operator[] |
( |
int | atomic_number | ) |
const |
|
inlineconstexprnoexcept |
Get element with the given atomic number.
- Parameters
-
| atomic_number | The atomic number of the element. |
- Returns
- A const reference to the element.
- Note
- The behavior is undefined if
atomic_number is not in range [0, 118].
◆ kElementCount_
| int nuri::PeriodicTable::kElementCount_ = 118 + 1 |
|
staticconstexpr |
The documentation for this class was generated from the following file: