Program Listing for File VegaSpectrum.hpp
↰ Return to documentation for file (src/phot/VegaSpectrum.hpp)
#ifndef VEGASPECTRUM_HPP
#define VEGASPECTRUM_HPP
#include "PhotCommons.hpp"
#include <string>
#include <utility>
#include <vector>
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<double>&, const std::vector<double>&>
{
return {wl_, flux_};
}
private:
std::vector<double> wl_;
std::vector<double> flux_;
};
inline auto vegaSpectrum(const std::string& vegaName = defaultVegaSpec)
-> std::pair<const std::vector<double>&, const std::vector<double>&>
{
static const VegaSpectrum instance(vegaName);
return instance.spectrum();
}
} // namespace phot
#endif // VEGASPECTRUM_HPP