7 operator()(
const std::string& option_name)
const
11 if (option.Name() == option_name)
15 throw std::out_of_range(
"Basic option " + option_name +
16 " does not appear to exist.");
26 if (index < options_.size())
27 return options_[index];
29 throw std::out_of_range(
"Basic option with index " + std::to_string(index) +
30 " does not appear to exist.");
39 for (
auto& option : options_)
41 if (option.Name() == option_name)
45 throw std::out_of_range(
"Basic option \"" + option_name +
46 "\" does not appear to exist.");
56 if (index < options_.size())
57 return options_[index];
59 throw std::out_of_range(
"Basic option with index " + std::to_string(index) +
60 " does not appear to exist.");
65void chi_physics::BasicOptions::
66 AddOption<std::string>(
const std::string &option_name,
67 const std::string& value)
69 options_.emplace_back(option_name, value);
73void chi_physics::BasicOptions::
74 AddOption<bool>(
const std::string &option_name,
const bool& value)
76 options_.emplace_back(option_name, value);
80void chi_physics::BasicOptions::
81 AddOption<int64_t>(
const std::string &option_name,
const int64_t& value)
83 options_.emplace_back(option_name, value);
87void chi_physics::BasicOptions::
88 AddOption<double>(
const std::string &option_name,
const double& value)
90 options_.emplace_back(option_name, value);
101 for (
const auto& option : options_)
103 if (option.Name() == option_name)
108 throw std::out_of_range(
"Basic option " + option_name +
109 " does not appear to exist.");
BasicOption & operator[](const std::string &option_name)
std::vector< BasicOption > options_
size_t GetOptionIndexFromName(const std::string &option_name) const
const BasicOption & operator()(const std::string &option_name) const