.. _program_listing_file_src_phot_VegaSpectrum.hpp: Program Listing for File VegaSpectrum.hpp ========================================= |exhale_lsh| :ref:`Return to documentation for file ` (``src/phot/VegaSpectrum.hpp``) .. |exhale_lsh| unicode:: U+021B0 .. UPWARDS ARROW WITH TIP LEFTWARDS .. code-block:: cpp #ifndef VEGASPECTRUM_HPP #define VEGASPECTRUM_HPP #include "PhotCommons.hpp" #include #include #include namespace phot { class VegaSpectrum { public: explicit VegaSpectrum(const std::string& vegaName = defaultVegaSpec); ~VegaSpectrum() = default; // Disable copy and move constructors and assignment operators, // since this class is meant to be used only via a single, // shared instance -- see vegaSpectrum() VegaSpectrum(const VegaSpectrum&) = delete; VegaSpectrum(VegaSpectrum&&) = delete; auto operator=(const VegaSpectrum&) -> VegaSpectrum& = delete; auto operator=(VegaSpectrum&&) -> VegaSpectrum& = delete; [[nodiscard]] auto spectrum() const -> std::pair&, const std::vector&> { return {wl_, flux_}; } private: std::vector wl_; std::vector flux_; }; inline auto vegaSpectrum(const std::string& vegaName = defaultVegaSpec) -> std::pair&, const std::vector&> { static const VegaSpectrum instance(vegaName); return instance.spectrum(); } } // namespace phot #endif // VEGASPECTRUM_HPP