9 std::map<std::string, Element>::const_iterator ptr =
elements_.find(name);
11 throw std::runtime_error(
"[ Parameter Not Found ]: Integer parameter '" + name +
"' not found");
14 throw std::runtime_error(
"[ Parameter Type Error ]: Parameter '" + name +
"' is not an integer");
16 return ptr->second.intval_;
20 std::map<std::string, Element>::const_iterator ptr =
elements_.find(name);
25 throw std::runtime_error(
"[ Parameter Type Error ]: Parameter '" + name +
"' is not an integer");
27 return ptr->second.intval_;
35 std::map<std::string, Element>::const_iterator ptr =
elements_.find(name);
37 throw std::runtime_error(
"[ Parameter Not Found ]: Double parameter '" + name +
"' not found");
40 throw std::runtime_error(
"[ Parameter Type Error ]: Parameter '" + name +
"' is not a double");
42 return ptr->second.doubleval_;
46 std::map<std::string, Element>::const_iterator ptr =
elements_.find(name);
51 throw std::runtime_error(
"[ Parameter Type Error ]: Parameter '" + name +
"' is not a double");
53 return ptr->second.doubleval_;
61 std::map<std::string, Element>::const_iterator ptr =
elements_.find(name);
63 throw std::runtime_error(
"[ Parameter Not Found ]: String parameter '" + name +
"' not found");
66 throw std::runtime_error(
"[ Parameter Type Error ]: Parameter '" + name +
"' is not a string");
68 return ptr->second.strval_;
72 std::map<std::string, Element>::const_iterator ptr =
elements_.find(name);
77 throw std::runtime_error(
"[ Parameter Type Error ]: Parameter '" + name +
"' is not a string");
79 return ptr->second.strval_;
92 std::map<std::string, Element>::const_iterator ptr =
elements_.find(name);
94 throw std::runtime_error(
"[ Parameter Not Found ]: Parameter '" + name +
"' not found");
97 throw std::runtime_error(
"[ Parameter Type Error ]: Parameter '" + name +
"' is not a vector of integers");
99 return ptr->second.ivecVal_;
103 std::map<std::string, Element>::const_iterator ptr =
elements_.find(name);
108 throw std::runtime_error(
"[ Parameter Type Error ]: Parameter '" + name +
"' is not a vector of integers");
110 return ptr->second.ivecVal_;
123 std::map<std::string, Element>::const_iterator ptr =
elements_.find(name);
125 throw std::runtime_error(
"[ Parameter Not Found ]: Parameter '" + name +
"' not found");
128 throw std::runtime_error(
"[ Parameter Type Error ]: Parameter '" + name +
"' is not a vector of doubles");
130 return ptr->second.dvecVal_;
134 std::map<std::string, Element>::const_iterator ptr =
elements_.find(name);
139 throw std::runtime_error(
"[ Parameter Type Error ]: Parameter '" + name +
"' is not a vector of doubles");
141 return ptr->second.dvecVal_;
154 std::map<std::string, Element>::const_iterator ptr =
elements_.find(name);
156 throw std::runtime_error(
"[ Parameter Not Found ]: Parameter '" + name +
"' not found");
159 throw std::runtime_error(
"[ Parameter Type Error ]: Parameter '" + name +
"' is not a vector of strings");
161 return ptr->second.svecVal_;
164const std::vector<std::string>&
ParameterSet::getVString(
const std::string& name,
const std::vector<std::string>& defaultValue)
const {
165 std::map<std::string, Element>::const_iterator ptr =
elements_.find(name);
170 throw std::runtime_error(
"[ Parameter Type Error ]: Parameter '" + name +
"' is not a vector of strings");
172 return ptr->second.svecVal_;
164const std::vector<std::string>&
ParameterSet::getVString(
const std::string& name,
const std::vector<std::string>& defaultValue)
const {
…}
Class which contains parameters passed to a Processor.
const std::vector< int > & getVInteger(const std::string &name) const
Get a vector of integers by name or throw an exception if not available, or not the right type.
const std::vector< double > & getVDouble(const std::string &name) const
Get a vector of doubles by name or throw an exception if not available, or not the right type.
const std::string & getString(const std::string &name) const
const std::vector< std::string > & getVString(const std::string &name) const
Get a vector of strings by name or throw an exception if not available, or not the right type.
void insert(const std::string &name, int value)
Add an integer to the ParameterSet.
std::map< std::string, Element > elements_
double getDouble(const std::string &name) const
Get a double by name or throw an exception if not available, or not the right type.
int getInteger(const std::string &name) const
Get an integer by name or throw an exception if not available, or not the right type.
Backing data structure containing parameter values.