Celeritas 0.7.0-dev.242+develop.62c3034b
Loading...
Searching...
No Matches
Public Member Functions | List of all members
celeritas::AtomicNumber Class Reference

Type-safe atomic number identifier. More...

#include <AtomicNumber.hh>

Public Member Functions

constexpr AtomicNumber ()=default
 Construct with an invalid/unassigned value of zero.
 
constexpr AtomicNumber (int z_or_a_value)
 Construct with the Z value.
 
constexpr operator bool () const
 True if value is assigned/valid.
 
constexpr int unchecked_get () const
 Get the Z or A value.
 
int get () const
 Get Z or A value.
 

Detailed Description

Type-safe atomic number identifier.

Atomic numbers (Z and A) have constraints that integers do not (zero is not an atomic number, dividing one atomic number by another is meaningless) so this type improves the semantics and safety.

Generally speaking, Z and A numbers are used during setup and when evaluating expressions that use atomic charge. Z or A should not be used to "index" data during runtime.

Constructing with a nonpositive values gives the result in a false state (get will throw a DebugError).


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