.. _program_listing_file_src_elem_IsotopeTable.hpp: Program Listing for File IsotopeTable.hpp ========================================= |exhale_lsh| :ref:`Return to documentation for file ` (``src/elem/IsotopeTable.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #ifndef ISOTOPETABLE_HPP #define ISOTOPETABLE_HPP #include "ElemCommons.hpp" #include "IsotopeData.hpp" #include #include #include #include #include #include #include #include namespace elem { class IsotopeTable { public: explicit IsotopeTable(const std::string& fileName = "data/elem/isotopes.h5"); [[nodiscard]] auto table() const noexcept -> const std::map, IsotopeData>& { return table_; } [[nodiscard]] auto size() const noexcept -> std::size_t { return table_.size(); } private: std::map, IsotopeData> table_; }; inline auto isotopeTable() -> IsotopeTable& { try { static IsotopeTable instance; return instance; } catch (const std::exception& error) { std::cerr << "FATAL: isotope table initialization failed: " << error.what() << "\n"; std::exit(1); // NOLINT(concurrency-mt-unsafe) -- the program is terminating regardless; thread-safety of the shutdown path doesn't matter } } inline auto isotopeTable(unsigned int z, unsigned int a) -> const IsotopeData& { return isotopeTable().table().at({z, a}); } [[nodiscard]] auto effectiveDaughters(const IsotopeData& parent, const IsotopeList& skippedIsotopes) -> std::vector; } // namespace elem #endif // ISOTOPETABLE_HPP