27 std::map<string, Item<double> >::const_iterator p =
m_map_double.find(key);
30 return p->second.value();
33 vout.
crucial(
"get_double: key '%s' not found.\n", key.c_str());
42 std::map<string, Item<int> >::const_iterator p =
m_map_int.find(key);
45 return p->second.value();
48 vout.
crucial(
"get_int: key '%s' not found.\n", key.c_str());
57 std::map<string, Item<std::valarray<double> > >::const_iterator p =
m_map_double_vector.find(key);
60 return p->second.value();
63 vout.
crucial(
"get_double_vector: key '%s' not found.\n", key.c_str());
65 return std::valarray<double>();
72 std::map<string, Item<std::valarray<int> > >::const_iterator p =
m_map_int_vector.find(key);
75 return p->second.value();
78 vout.
crucial(
"get_int_vector: key '%s' not found.\n", key.c_str());
80 return std::valarray<int>();
87 std::map<string, Item<string> >::const_iterator p =
m_map_string.find(key);
90 return p->second.value();
93 vout.
crucial(
"get_Parameters: key '%s' not found.\n", key.c_str());
102 std::map<string, Item<Parameters *> >::const_iterator p =
m_map_Parameters.find(key);
105 return p->second.value();
108 vout.
crucial(
"Warning: get_Parameters: key '%s' is not used.\n", key.c_str());
126 std::map<string, Item<double> >::const_iterator p =
m_map_double.find(key);
129 vout.
crucial(
"Parameters: parameter entry not found: %s.\n", key.c_str());
134 val = p->second.value();
136 return p->second.is_set();
143 std::map<string, Item<int> >::const_iterator p =
m_map_int.find(key);
146 vout.
crucial(
"Parameters: parameter entry not found: %s.\n", key.c_str());
151 val = p->second.value();
153 return p->second.is_set();
160 std::map<string, Item<std::valarray<double> > >::const_iterator p =
m_map_double_vector.find(key);
163 vout.
crucial(
"Parameters: parameter entry not found: %s.\n", key.c_str());
168 val.resize(p->second.value().size());
169 val = p->second.value();
171 return p->second.is_set();
178 std::map<string, Item<std::valarray<int> > >::const_iterator p =
m_map_int_vector.find(key);
181 vout.
crucial(
"Parameters: parameter entry not found: %s.\n", key.c_str());
186 val.resize(p->second.value().size());
187 val = p->second.value();
189 return p->second.is_set();
196 std::map<string, Item<string> >::const_iterator p =
m_map_string.find(key);
199 vout.
crucial(
"Parameters: parameter entry not found: %s.\n", key.c_str());
204 val = p->second.value();
206 return p->second.is_set();
264 std::map<string, Item<int> >::iterator p =
m_map_int.find(key);
266 if (p !=
m_map_int.end()) p->second.put(value);
273 std::map<string, Item<double> >::iterator p =
m_map_double.find(key);
282 std::map<string, Item<std::valarray<int> > >::iterator p =
m_map_int_vector.find(key);
291 std::map<string, Item<std::valarray<double> > >::iterator p =
m_map_double_vector.find(key);
300 std::map<string, Item<string> >::iterator p =
m_map_string.find(key);
309 std::map<string, Item<Parameters *> >::iterator p =
m_map_Parameters.find(key);
347 m_map_int_vector.insert(std::map<
string,
Item<std::valarray<int> > >::value_type(key,
Item<std::valarray<int> >(data)));
372 std::map<string, Item<double> >::const_iterator p =
m_map_double.find(key);
374 return p->second.is_set() == EXIT_SUCCESS;
379 std::map<string, Item<int> >::const_iterator p =
m_map_int.find(key);
382 return p->second.is_set() == EXIT_SUCCESS;
387 std::map<string, Item<std::valarray<double> > >::const_iterator p =
m_map_double_vector.find(key);
390 return p->second.is_set() == EXIT_SUCCESS;
395 std::map<string, Item<std::valarray<int> > >::const_iterator p =
m_map_int_vector.find(key);
398 return p->second.is_set() == EXIT_SUCCESS;
403 std::map<string, Item<string> >::const_iterator p =
m_map_string.find(key);
406 return p->second.is_set() == EXIT_SUCCESS;
411 std::map<string, Item<Parameters *> >::const_iterator p =
m_map_Parameters.find(key);
414 return p->second.is_set() == EXIT_SUCCESS;
419 if (key ==
"verbose_level") {
431 void Parameters::dump(
const string& indent_str)
const
433 const char *indent = indent_str.c_str();
436 printf(
"%s[double]\n", indent);
438 printf(
"%s key = %s, val = %f, set = %s\n", indent, p->first.c_str(), p->second.value(), (p->second.m_flag_set ?
"true" :
"false"));
443 printf(
"%s[integer]\n", indent);
444 for (std::map<
string, Item<int> >::const_iterator p =
m_map_int.begin(); p !=
m_map_int.end(); ++p) {
445 printf(
"%s key = %s, val = %d, set = %s\n", indent, p->first.c_str(), p->second.value(), (p->second.m_flag_set ?
"true" :
"false"));
450 printf(
"%s[double vector]\n", indent);
452 printf(
"%s key = %s, val = (", indent, p->first.c_str());
453 for (
size_t i = 0; i < p->second.value().size(); ++i) {
454 printf(
"%f, ", (p->second.value())[i]);
456 printf(
"), set = %s\n", (p->second.m_flag_set ?
"true" :
"false"));
461 printf(
"%s[integer vector]\n", indent);
463 printf(
"%s key = %s, val = (", indent, p->first.c_str());
464 for (
size_t i = 0; i < p->second.value().size(); ++i) {
465 printf(
"%d, ", (p->second.value())[i]);
467 printf(
"), set = %s\n", (p->second.m_flag_set ?
"true" :
"false"));
472 printf(
"%s[string]\n", indent);
474 printf(
"%s key = %s, val = %s, set = %s\n", indent, p->first.c_str(), p->second.value().c_str(), (p->second.m_flag_set ?
"true" :
"false"));
479 printf(
"%s[Parameters]\n", indent);
481 printf(
"%s key = %s, val = %p, set = %s\n", indent, p->first.c_str(), p->second.value(), (p->second.m_flag_set ?
"true" :
"false"));
484 if (p->second.value()) {
485 p->second.value()->dump(indent_str +
" ");
487 printf(
"%s<empty value>\n", indent);
492 printf(
"%s[verbosity]\n", indent);
495 printf(
"%s--------\n", indent);
bool find_int(const string &) const
int fetch_VerboseLevel(Bridge::VerboseLevel &val) const
void Register_string(const string &, const string &)
std::valarray< int > get_int_vector(const string &key) const
void Register_int(const string &, const int)
void set_int(const string &key, const int value)
bool find_double(const string &) const
bool find_Parameters(const string &) const
int get_int(const string &key) const
std::map< string, Item< std::valarray< int > > > m_map_int_vector
int fetch_int_vector(const string &key, std::valarray< int > &val) const
void set_VerboseLevel(Bridge::VerboseLevel value)
Parameters * get_Parameters(const string &key) const
std::map< string, Item< Parameters * > > m_map_Parameters
int fetch_double_vector(const string &key, std::valarray< double > &val) const
void set_string(const string &key, const string &value)
bool find_string(const string &) const
std::map< string, Item< int > > m_map_int
bool is_set(const string &) const
std::map< string, Item< double > > m_map_double
double get_double(const string &key) const
std::map< string, Item< std::valarray< double > > > m_map_double_vector
std::valarray< double > get_double_vector(const string &key) const
int fetch_string(const string &key, string &val) const
Common parameter class: provides parameters as singleton.
bool find_double_vector(const string &) const
void set_double_vector(const string &key, const std::valarray< double > &value)
Bridge::VerboseLevel get_VerboseLevel() const
void crucial(const char *format,...)
std::map< string, Item< string > > m_map_string
void Register_Parameters(const string &, Parameters *const)
void put(const std::valarray< U > &value)
void set_double(const string &key, const double value)
void set_Parameters(const string &key, Parameters *const value)
void Register_double_vector(const string &, const std::valarray< double > &)
void Register_double(const string &, const double)
void Register_int_vector(const string &, const std::valarray< int > &)
int fetch_double(const string &key, double &val) const
string get_string(const string &key) const
void set_int_vector(const string &key, const std::valarray< int > &value)
bool find_int_vector(const string &) const
int fetch_int(const string &key, int &val) const
Item< Bridge::VerboseLevel > m_vlevel