Bridge++  Ver. 2.0.2
parameters.cpp
Go to the documentation of this file.
1 
14 #include "parameters.h"
15 
16 #include "Tools/evalexpr.h"
17 #include <regex.h>
18 
19 const std::string Parameters::class_name = "Parameters";
20 
21 //====================================================================
23  : m_vlevel(CommonParameters::Vlevel())
24 {
25  // default verbosity from common_parameters.
26 }
27 
28 
29 //====================================================================
30 void Parameters::set_bool(const string& key, const bool value)
31 { m_map_string[key] = value ? "true" : "false"; }
32 
33 void Parameters::set_double(const string& key, const double value)
34 { m_map_double[key] = value; }
35 
36 void Parameters::set_int(const string& key, const int value)
37 { m_map_int[key] = value; }
38 
39 void Parameters::set_string(const string& key, const string& value)
40 { m_map_string[key] = value; }
41 
42 void Parameters::set_double_vector(const string& key, const vector<double>& value)
43 { m_map_double_vector[key] = value; }
44 
45 void Parameters::set_int_vector(const string& key, const vector<int>& value)
46 { m_map_int_vector[key] = value; }
47 
48 void Parameters::set_string_vector(const string& key, const vector<string>& value)
49 { m_map_string_vector[key] = value; }
50 
51 void Parameters::set_Parameters(const string& key, const Parameters& value)
52 { m_map_parameters[key] = value; }
53 
55 { m_vlevel = value; }
56 
57 //====================================================================
58 
59 //----------------------------------------------------------------
60 // floating-point parameter values:
61 // processed by EvalExpr class that accepts
62 // literal values, arithmetic expressions, predefined symbols (e.g. pi).
63 // see Tools/evalexpr.h
64 //
65 
66 double Parameters::convert_to_double(const string& value) const
67 {
68  return EvalExpr(value).parse();
69 }
70 
71 
72 vector<double> Parameters::convert_to_double(const vector<string>& value) const
73 {
74  vector<double> v;
75  for (size_t i = 0; i < value.size(); ++i) {
76  v.push_back(convert_to_double(value[i]));
77  }
78  return v;
79 }
80 
81 
82 //----------------------------------------------------------------
83 // integer parameter values:
84 // [-+]{digits}
85 //
86 // example:
87 // 42
88 // -7
89 // +6
90 // - 99 <- not allowed. sign and digits are not spaced.
91 // 3 7 <- not allowed. only one number is accepted.
92 //
93 
94 namespace {
95  const char integer_pattern[] = "^[ \t]*([-+]?[0-9]+)[ \t]*$";
96 
97  regex_t regobj;
98 
99  void do_finalize()
100  {
101  regfree(&regobj);
102  }
103 
104 
105  bool do_init()
106  {
107  if (regcomp(&regobj, integer_pattern, REG_EXTENDED | REG_NEWLINE | REG_NOSUB) != 0) {
108  vout.crucial("Parameters: compilation of regular expression failed.\n");
109  return false;
110  }
111  atexit(do_finalize);
112  return true;
113  }
114 
115 
116  bool _init = do_init();
117 }
118 
119 int Parameters::convert_to_int(const string& value) const
120 {
121  // sanity check
122  if (_init && (regexec(&regobj, value.c_str(), 0, NULL, 0) == 0)) {
123  } else {
124  vout.crucial("%s: warning: irregular integer expression \"%s\".\n", class_name.c_str(), value.c_str());
125  exit(EXIT_FAILURE);
126  }
127 
128  return atoi(value.c_str());
129 }
130 
131 
132 vector<int> Parameters::convert_to_int(const vector<string>& value) const
133 {
134  vector<int> v;
135  for (size_t i = 0; i < value.size(); ++i) {
136  v.push_back(convert_to_int(value[i]));
137  }
138  return v;
139 }
140 
141 
142 //----------------------------------------------------------------
143 // boolean parameter values:
144 // true = { "true", "yes", "on", "1", positive integer values }
145 // false = otherwise
146 //
147 
148 bool Parameters::convert_to_bool(const string& value) const
149 {
150  if ((value == "true") || (value == "TRUE") || (value == "True") ||
151  (value == "yes") || (value == "YES") || (value == "Yes") ||
152  (value == "1") // for backward compatibility
153  ) {
154  return true;
155  } else if ((value == "false") || (value == "FALSE") || (value == "False") ||
156  (value == "no") || (value == "NO") || (value == "No") ||
157  (value == "0") // for backward compatibility
158  ) {
159  return false;
160  } else {
161  vout.crucial("%s: warning: unrecognized value for boolean parameter \"%s\".\n", class_name.c_str(), value.c_str());
162  exit(EXIT_FAILURE);
163  return false; // never reached
164  }
165 }
166 
167 
168 bool Parameters::convert_to_bool(int value) const
169 {
170  return value > 0;
171 }
172 
173 
174 //====================================================================
175 double Parameters::get_double(const string& key) const
176 {
177  map<string, double>::const_iterator p = m_map_double.find(key);
178  if (p != m_map_double.end()) {
179  return p->second;
180  }
181 
182  map<string, string>::const_iterator q = m_map_string.find(key);
183  if (q != m_map_string.end()) {
184  return convert_to_double(q->second);
185  }
186 
187  vout.crucial("%s: %s: key '%s' not found.\n", class_name.c_str(), __func__, key.c_str());
188  return double();
189 }
190 
191 
192 int Parameters::get_int(const string& key) const
193 {
194  map<string, int>::const_iterator p = m_map_int.find(key);
195  if (p != m_map_int.end()) {
196  return p->second;
197  }
198 
199  map<string, string>::const_iterator q = m_map_string.find(key);
200  if (q != m_map_string.end()) {
201  return convert_to_int(q->second);
202  }
203 
204  vout.crucial("%s: %s: key '%s' not found.\n", class_name.c_str(), __func__, key.c_str());
205  return int();
206 }
207 
208 
209 unsigned long Parameters::get_unsigned_long(const string& key) const
210 {
211  map<string, string>::const_iterator q = m_map_string.find(key);
212  if (q != m_map_string.end()) {
213  return strtoul(q->second.c_str(), NULL, 0);
214  }
215 
216  vout.crucial("%s: %s: key '%s' not found.\n", class_name.c_str(), __func__, key.c_str());
217  return 0;
218 }
219 
220 
221 string Parameters::get_string(const string& key) const
222 {
223  map<string, string>::const_iterator p = m_map_string.find(key);
224  if (p != m_map_string.end()) {
225  return p->second;
226  }
227 
228  vout.crucial("%s: %s: key '%s' not found.\n", class_name.c_str(), __func__, key.c_str());
229  return string();
230 }
231 
232 
233 bool Parameters::get_bool(const string& key) const
234 {
235  map<string, string>::const_iterator p = m_map_string.find(key);
236  if (p != m_map_string.end()) {
237  return convert_to_bool(p->second);
238  }
239 
240  map<string, int>::const_iterator q = m_map_int.find(key);
241  if (q != m_map_int.end()) {
242  return convert_to_bool(q->second);
243  }
244 
245  vout.crucial("%s: %s: key '%s' not found.\n", class_name.c_str(), __func__, key.c_str());
246  return false;
247 }
248 
249 
250 vector<double> Parameters::get_double_vector(const string& key) const
251 {
252  map<string, vector<double> >::const_iterator p = m_map_double_vector.find(key);
253  if (p != m_map_double_vector.end()) {
254  return p->second;
255  }
256 
257  map<string, vector<string> >::const_iterator q = m_map_string_vector.find(key);
258  if (q != m_map_string_vector.end()) {
259  return convert_to_double(q->second);
260  }
261 
262  vout.crucial("%s: %s: key '%s' not found.\n", class_name.c_str(), __func__, key.c_str());
263  return vector<double>();
264 }
265 
266 
267 vector<int> Parameters::get_int_vector(const string& key) const
268 {
269  map<string, vector<int> >::const_iterator p = m_map_int_vector.find(key);
270  if (p != m_map_int_vector.end()) {
271  return p->second;
272  }
273 
274  map<string, vector<string> >::const_iterator q = m_map_string_vector.find(key);
275  if (q != m_map_string_vector.end()) {
276  return convert_to_int(q->second);
277  }
278 
279  vout.crucial("%s: %s: key '%s' not found.\n", class_name.c_str(), __func__, key.c_str());
280  return vector<int>();
281 }
282 
283 
284 vector<string> Parameters::get_string_vector(const string& key) const
285 {
286  map<string, vector<string> >::const_iterator p = m_map_string_vector.find(key);
287  if (p != m_map_string_vector.end()) {
288  return p->second;
289  }
290 
291  vout.crucial("%s: %s: key '%s' not found.\n", class_name.c_str(), __func__, key.c_str());
292  return vector<string>();
293 }
294 
295 
296 Parameters Parameters::get_Parameters(const string& key) const
297 {
298  map<string, Parameters>::const_iterator p = m_map_parameters.find(key);
299  if (p != m_map_parameters.end()) {
300  return p->second;
301  }
302 
303  vout.crucial("%s: %s: key '%s' not found.\n", class_name.c_str(), __func__, key.c_str());
304  return Parameters();
305 }
306 
307 
309 {
310  map<string, Parameters>::iterator p = m_map_parameters.find(key);
311  if (p != m_map_parameters.end()) {
312  return p->second;
313  }
314 
315  vout.crucial("%s: %s: key '%s' not found.\n", class_name.c_str(), __func__, key.c_str());
316  return *this;
317 }
318 
319 
321 {
322  return m_vlevel;
323 }
324 
325 
326 //====================================================================
327 int Parameters::fetch_double(const string& key, double& value) const
328 {
329  map<string, double>::const_iterator p = m_map_double.find(key);
330  if (p != m_map_double.end()) {
331  value = p->second;
332  return EXIT_SUCCESS;
333  }
334 
335  map<string, string>::const_iterator q = m_map_string.find(key);
336  if (q != m_map_string.end()) {
337  value = convert_to_double(q->second);
338  return EXIT_SUCCESS;
339  }
340 
341  vout.crucial("%s: %s: key '%s' not found.\n", class_name.c_str(), __func__, key.c_str());
342  return EXIT_FAILURE;
343 }
344 
345 
346 int Parameters::fetch_int(const string& key, int& value) const
347 {
348  map<string, int>::const_iterator p = m_map_int.find(key);
349  if (p != m_map_int.end()) {
350  value = p->second;
351  return EXIT_SUCCESS;
352  }
353 
354  map<string, string>::const_iterator q = m_map_string.find(key);
355  if (q != m_map_string.end()) {
356  value = convert_to_int(q->second);
357  return EXIT_SUCCESS;
358  }
359 
360  vout.crucial("%s: %s: key '%s' not found.\n", class_name.c_str(), __func__, key.c_str());
361  return EXIT_FAILURE;
362 }
363 
364 
365 int Parameters::fetch_unsigned_long(const string& key, unsigned long& value) const
366 {
367  map<string, string>::const_iterator q = m_map_string.find(key);
368  if (q != m_map_string.end()) {
369  value = strtoul(q->second.c_str(), NULL, 0);
370  return EXIT_SUCCESS;
371  }
372 
373  vout.crucial("%s: %s: key '%s' not found.\n", class_name.c_str(), __func__, key.c_str());
374  return EXIT_FAILURE;
375 }
376 
377 
378 int Parameters::fetch_string(const string& key, string& value) const
379 {
380  map<string, string>::const_iterator p = m_map_string.find(key);
381  if (p != m_map_string.end()) {
382  value = p->second;
383  return EXIT_SUCCESS;
384  }
385 
386  vout.crucial("%s: %s: key '%s' not found.\n", class_name.c_str(), __func__, key.c_str());
387  return EXIT_FAILURE;
388 }
389 
390 
391 int Parameters::fetch_bool(const string& key, bool& value) const
392 {
393  map<string, string>::const_iterator p = m_map_string.find(key);
394  if (p != m_map_string.end()) {
395  value = convert_to_bool(p->second);
396  return EXIT_SUCCESS;
397  }
398 
399  map<string, int>::const_iterator q = m_map_int.find(key);
400  if (q != m_map_int.end()) {
401  value = convert_to_bool(q->second);
402  return EXIT_SUCCESS;
403  }
404 
405  vout.crucial("%s: %s: key '%s' not found.\n", class_name.c_str(), __func__, key.c_str());
406  return EXIT_FAILURE;
407 }
408 
409 
410 int Parameters::fetch_double_vector(const string& key, vector<double>& value) const
411 {
412  map<string, vector<double> >::const_iterator p = m_map_double_vector.find(key);
413  if (p != m_map_double_vector.end()) {
414  value = p->second;
415  return EXIT_SUCCESS;
416  }
417 
418  map<string, vector<string> >::const_iterator q = m_map_string_vector.find(key);
419  if (q != m_map_string_vector.end()) {
420  value = convert_to_double(q->second);
421  return EXIT_SUCCESS;
422  }
423 
424  vout.crucial("%s: %s: key '%s' not found.\n", class_name.c_str(), __func__, key.c_str());
425  return EXIT_FAILURE;
426 }
427 
428 
429 int Parameters::fetch_int_vector(const string& key, vector<int>& value) const
430 {
431  map<string, vector<int> >::const_iterator p = m_map_int_vector.find(key);
432  if (p != m_map_int_vector.end()) {
433  value = p->second;
434  return EXIT_SUCCESS;
435  }
436 
437  map<string, vector<string> >::const_iterator q = m_map_string_vector.find(key);
438  if (q != m_map_string_vector.end()) {
439  value = convert_to_int(q->second);
440  return EXIT_SUCCESS;
441  }
442 
443  vout.crucial("%s: %s: key '%s' not found.\n", class_name.c_str(), __func__, key.c_str());
444  return EXIT_FAILURE;
445 }
446 
447 
448 int Parameters::fetch_string_vector(const string& key, vector<string>& value) const
449 {
450  map<string, vector<string> >::const_iterator p = m_map_string_vector.find(key);
451  if (p != m_map_string_vector.end()) {
452  value = p->second;
453  return EXIT_SUCCESS;
454  }
455 
456  vout.crucial("%s: %s: key '%s' not found.\n", class_name.c_str(), __func__, key.c_str());
457  return EXIT_FAILURE;
458 }
459 
460 
462 {
463  value = m_vlevel;
464  return EXIT_SUCCESS;
465 }
466 
467 
468 //====================================================================
469 void Parameters::Register_double(const string& key, const double defvalue)
470 { vout.crucial("%s: %s: unsupported.\n", class_name.c_str(), __func__); }
471 
472 void Parameters::Register_int(const string& key, const int defvalue)
473 { vout.crucial("%s: %s: unsupported.\n", class_name.c_str(), __func__); }
474 
475 void Parameters::Register_string(const string& key, const string& defvalue)
476 { vout.crucial("%s: %s: unsupported.\n", class_name.c_str(), __func__); }
477 
478 void Parameters::Register_double_vector(const string& key, const vector<double>& defvalue)
479 { vout.crucial("%s: %s: unsupported.\n", class_name.c_str(), __func__); }
480 
481 void Parameters::Register_int_vector(const string& key, const vector<int>& defvalue)
482 { vout.crucial("%s: %s: unsupported.\n", class_name.c_str(), __func__); }
483 
484 void Parameters::Register_string_vector(const string& key, const vector<string>& defvalue)
485 { vout.crucial("%s: %s: unsupported.\n", class_name.c_str(), __func__); }
486 
487 void Parameters::Register_Parameters(const string& key, const Parameters& defvalue)
488 { vout.crucial("%s: %s: unsupported.\n", class_name.c_str(), __func__); }
489 
490 void Parameters::Register_Parameters(const string& key, Parameters *const defvalue)
491 { vout.crucial("%s: %s: unsupported.\n", class_name.c_str(), __func__); }
492 
493 //====================================================================
494 bool Parameters::find_double(const string& key) const
495 { return m_map_double.find(key) != m_map_double.end() || m_map_string.find(key) != m_map_string.end(); }
496 
497 bool Parameters::find_int(const string& key) const
498 { return m_map_int.find(key) != m_map_int.end() || m_map_string.find(key) != m_map_string.end(); }
499 
500 bool Parameters::find_unsigned_long(const string& key) const
501 {
502  // unsigned long value is stored as a string.
503  return m_map_string.find(key) != m_map_string.end();
504 }
505 
506 
507 bool Parameters::find_string(const string& key) const
508 { return m_map_string.find(key) != m_map_string.end(); }
509 
510 bool Parameters::find_bool(const string& key) const
511 { return m_map_string.find(key) != m_map_string.end() || m_map_int.find(key) != m_map_int.end(); }
512 
513 bool Parameters::find_double_vector(const string& key) const
514 { return m_map_double_vector.find(key) != m_map_double_vector.end() || m_map_string_vector.find(key) != m_map_string_vector.end(); }
515 
516 bool Parameters::find_int_vector(const string& key) const
517 { return m_map_int_vector.find(key) != m_map_int_vector.end() || m_map_string_vector.find(key) != m_map_string_vector.end(); }
518 
519 bool Parameters::find_string_vector(const string& key) const
520 { return m_map_string_vector.find(key) != m_map_string_vector.end(); }
521 
522 bool Parameters::find_Parameters(const string& key) const
523 { return m_map_parameters.find(key) != m_map_parameters.end(); }
524 
525 bool Parameters::is_set(const string& key) const
526 {
527  return find_double(key) ||
528  find_int(key) ||
529  find_unsigned_long(key) ||
530  find_string(key) ||
531  find_bool(key) ||
532  find_double_vector(key) ||
533  find_int_vector(key) ||
534  find_string_vector(key) ||
535  find_Parameters(key)
536  ;
537 }
538 
539 
540 //====================================================================
541 void Parameters::print(const string& indent) const
542 {
543  if (m_map_string.size() > 0) {
544  for (const std::pair<string, string>& kv : m_map_string) {
545  vout.general("%s%-30s\t%s\n", indent.c_str(), (kv.first + ":").c_str(), kv.second.c_str());
546  }
547  }
548  if (m_map_int.size() > 0) {
549  for (const std::pair<string, int>& kv : m_map_int) {
550  vout.general("%s%-30s\t%d\n", indent.c_str(), (kv.first + ":").c_str(), kv.second);
551  }
552  }
553  if (m_map_double.size() > 0) {
554  for (const std::pair<string, double>& kv : m_map_double) {
555  vout.general("%s%-30s\t%e\n", indent.c_str(), (kv.first + ":").c_str(), kv.second);
556  }
557  }
558  if (m_map_string_vector.size() > 0) {
559  for (const std::pair<string, vector<string> >& kv : m_map_string_vector) {
560  vout.general("%s%-30s\t%s\n", indent.c_str(), (kv.first + ":").c_str(), to_string(kv.second).c_str());
561  }
562  }
563  if (m_map_int_vector.size() > 0) {
564  for (const std::pair<string, vector<int> >& kv : m_map_int_vector) {
565  vout.general("%s%-30s\t%s\n", indent.c_str(), (kv.first + ":").c_str(), to_string(kv.second).c_str());
566  }
567  }
568  if (m_map_double_vector.size() > 0) {
569  for (const std::pair<string, vector<double> >& kv : m_map_double_vector) {
570  vout.general("%s%-30s\t%s\n", indent.c_str(), (kv.first + ":").c_str(), to_string(kv.second).c_str());
571  }
572  }
573  if (m_map_parameters.size() > 0) {
574  for (const std::pair<string, Parameters>& kv : m_map_parameters) {
575  vout.general("%s%-30s\t\n", indent.c_str(), (kv.first + ":").c_str());
576  kv.second.print(indent + " ");
577  }
578  }
579 }
580 
581 
582 //====================================================================
583 void Parameters::dump(const string& indent) const
584 {
585  printf("%sScalar<double>:\n", indent.c_str());
586  if (m_map_double.size() == 0) {
587  printf("%s (none)\n", indent.c_str());
588  } else {
589  for (map<string, double>::const_iterator p = m_map_double.begin(); p != m_map_double.end(); ++p) {
590  printf("%s key = %s\tvalue = %e\n", indent.c_str(), p->first.c_str(), p->second);
591  }
592  }
593 
594  printf("%sScalar<int>:\n", indent.c_str());
595  if (m_map_int.size() == 0) {
596  printf("%s (none)\n", indent.c_str());
597  } else {
598  for (map<string, int>::const_iterator p = m_map_int.begin(); p != m_map_int.end(); ++p) {
599  printf("%s key = %s\tvalue = %d\n", indent.c_str(), p->first.c_str(), p->second);
600  }
601  }
602 
603  printf("%sScalar<string>:\n", indent.c_str());
604  if (m_map_string.size() == 0) {
605  printf("%s (none)\n", indent.c_str());
606  } else {
607  for (map<string, string>::const_iterator p = m_map_string.begin(); p != m_map_string.end(); ++p) {
608  printf("%s key = %s\tvalue = %s\n", indent.c_str(), p->first.c_str(), p->second.c_str());
609  }
610  }
611 
612  printf("%sVector<double>:\n", indent.c_str());
613  if (m_map_double_vector.size() == 0) {
614  printf("%s (none)\n", indent.c_str());
615  } else {
616  for (map<string, vector<double> >::const_iterator p = m_map_double_vector.begin(); p != m_map_double_vector.end(); ++p) {
617  printf("%s key = %s\tvalue = [ \n", indent.c_str(), p->first.c_str());
618  for (size_t i = 0; i < p->second.size(); ++i) {
619  printf("%e, ", p->second[i]);
620  }
621  printf("]\n");
622  }
623  }
624 
625  printf("%sVector<int>:\n", indent.c_str());
626  if (m_map_int_vector.size() == 0) {
627  printf("%s (none)\n", indent.c_str());
628  } else {
629  for (map<string, vector<int> >::const_iterator p = m_map_int_vector.begin(); p != m_map_int_vector.end(); ++p) {
630  printf("%s key = %s\tvalue = [ \n", indent.c_str(), p->first.c_str());
631  for (size_t i = 0; i < p->second.size(); ++i) {
632  printf("%d, ", p->second[i]);
633  }
634  printf("]\n");
635  }
636  }
637 
638  printf("%sVector<string>:\n", indent.c_str());
639  if (m_map_string_vector.size() == 0) {
640  printf("%s (none)\n", indent.c_str());
641  } else {
642  for (map<string, vector<string> >::const_iterator p = m_map_string_vector.begin(); p != m_map_string_vector.end(); ++p) {
643  printf("%s key = %s\tvalue = [ ", indent.c_str(), p->first.c_str());
644  for (size_t i = 0; i < p->second.size(); ++i) {
645  printf("%s, ", p->second[i].c_str());
646  }
647  printf("]\n");
648  }
649  }
650 
651  printf("%sParameters:\n", indent.c_str());
652  if (m_map_parameters.size() == 0) {
653  printf("%s (none)\n", indent.c_str());
654  } else {
655  for (map<string, Parameters>::const_iterator p = m_map_parameters.begin(); p != m_map_parameters.end(); ++p) {
656  printf("%s key = %s, value:\n", indent.c_str(), p->first.c_str());
657  p->second.dump(indent + " ");
658  }
659  }
660 }
661 
662 
663 //====================================================================
664 //============================================================END=====
Parameters::set_bool
void set_bool(const string &key, const bool value)
Definition: parameters.cpp:30
EvalExpr
EvalExpr class for algebraic expression in parameter strings.
Definition: evalexpr.h:39
Parameters::find_string
bool find_string(const string &key) const
Definition: parameters.cpp:507
Parameters::set_VerboseLevel
void set_VerboseLevel(const Bridge::VerboseLevel value)
Definition: parameters.cpp:54
Parameters::set_string
void set_string(const string &key, const string &value)
Definition: parameters.cpp:39
CommonParameters
Common parameter class: provides parameters as singleton.
Definition: commonParameters.h:42
EvalExpr::parse
double parse()
Definition: evalexpr.cpp:177
Parameters
Class for parameters.
Definition: parameters.h:46
Parameters::Register_int_vector
void Register_int_vector(const string &key, const vector< int > &defvalue)
Definition: parameters.cpp:481
Parameters::set_double
void set_double(const string &key, const double value)
Definition: parameters.cpp:33
Parameters::m_map_int
map< string, int > m_map_int
Definition: parameters.h:120
Parameters::find_bool
bool find_bool(const string &key) const
Definition: parameters.cpp:510
Parameters::m_map_double_vector
map< string, vector< double > > m_map_double_vector
Definition: parameters.h:123
Parameters::get_int
int get_int(const string &key) const
Definition: parameters.cpp:192
Parameters::find_unsigned_long
bool find_unsigned_long(const string &key) const
Definition: parameters.cpp:500
Parameters::find_Parameters
bool find_Parameters(const string &key) const
Definition: parameters.cpp:522
Parameters::m_map_string
map< string, string > m_map_string
Definition: parameters.h:121
Parameters::m_map_parameters
map< string, Parameters > m_map_parameters
Definition: parameters.h:127
Parameters::Register_string_vector
void Register_string_vector(const string &key, const vector< string > &defvalue)
Definition: parameters.cpp:484
Parameters::m_map_int_vector
map< string, vector< int > > m_map_int_vector
Definition: parameters.h:124
Parameters::m_map_double
map< string, double > m_map_double
Definition: parameters.h:119
Parameters::set_double_vector
void set_double_vector(const string &key, const vector< double > &value)
Definition: parameters.cpp:42
Parameters::Register_string
void Register_string(const string &key, const string &defvalue)
Definition: parameters.cpp:475
Parameters::find_int_vector
bool find_int_vector(const string &key) const
Definition: parameters.cpp:516
Parameters::find_string_vector
bool find_string_vector(const string &key) const
Definition: parameters.cpp:519
Parameters::find_double_vector
bool find_double_vector(const string &key) const
Definition: parameters.cpp:513
Parameters::fetch_bool
int fetch_bool(const string &key, bool &value) const
Definition: parameters.cpp:391
Parameters::get_int_vector
vector< int > get_int_vector(const string &key) const
Definition: parameters.cpp:267
Parameters::to_string
static string to_string(const vector< T > &v)
Definition: parameters.h:148
Parameters::m_map_string_vector
map< string, vector< string > > m_map_string_vector
Definition: parameters.h:125
Parameters::print
void print(const string &indent="") const
Definition: parameters.cpp:541
Parameters::set_string_vector
void set_string_vector(const string &key, const vector< string > &value)
Definition: parameters.cpp:48
Parameters::convert_to_int
vector< int > convert_to_int(const vector< string > &) const
Definition: parameters.cpp:132
Parameters::fetch_string_vector
int fetch_string_vector(const string &key, vector< string > &value) const
Definition: parameters.cpp:448
Parameters::Parameters
Parameters()
Definition: parameters.cpp:22
Parameters::find_double
bool find_double(const string &key) const
Definition: parameters.cpp:494
Parameters::fetch_int_vector
int fetch_int_vector(const string &key, vector< int > &value) const
Definition: parameters.cpp:429
Parameters::convert_to_bool
bool convert_to_bool(const string &) const
Definition: parameters.cpp:148
Parameters::dump
void dump(const string &indent="") const
Definition: parameters.cpp:583
Parameters::convert_to_int
int convert_to_int(const string &) const
Definition: parameters.cpp:119
Parameters::set_Parameters
void set_Parameters(const string &key, const Parameters &value)
Definition: parameters.cpp:51
Parameters::get_bool
bool get_bool(const string &key) const
Definition: parameters.cpp:233
Parameters::get_double
double get_double(const string &key) const
Definition: parameters.cpp:175
Parameters::class_name
static const std::string class_name
Definition: parameters.h:49
parameters.h
Parameters::set_int_vector
void set_int_vector(const string &key, const vector< int > &value)
Definition: parameters.cpp:45
Parameters::get_unsigned_long
unsigned long get_unsigned_long(const string &key) const
Definition: parameters.cpp:209
Parameters::is_set
bool is_set(const string &key) const
Definition: parameters.cpp:525
Parameters::Register_int
void Register_int(const string &key, const int defvalue)
Definition: parameters.cpp:472
Parameters::set_int
void set_int(const string &key, const int value)
Definition: parameters.cpp:36
Parameters::convert_to_double
double convert_to_double(const string &) const
Definition: parameters.cpp:66
evalexpr.h
Parameters::fetch_string
int fetch_string(const string &key, string &value) const
Definition: parameters.cpp:378
Parameters::fetch_double
int fetch_double(const string &key, double &value) const
Definition: parameters.cpp:327
Parameters::get_VerboseLevel
Bridge::VerboseLevel get_VerboseLevel() const
Definition: parameters.cpp:320
Parameters::get_string
string get_string(const string &key) const
Definition: parameters.cpp:221
Bridge::BridgeIO::crucial
void crucial(const char *format,...)
Definition: bridgeIO.cpp:180
Parameters::get_Parameters
Parameters get_Parameters(const string &key) const
Definition: parameters.cpp:296
Bridge::VerboseLevel
VerboseLevel
Definition: bridgeIO.h:42
Parameters::find_int
bool find_int(const string &key) const
Definition: parameters.cpp:497
Parameters::get_double_vector
vector< double > get_double_vector(const string &key) const
Definition: parameters.cpp:250
Parameters::fetch_double_vector
int fetch_double_vector(const string &key, vector< double > &value) const
Definition: parameters.cpp:410
Parameters::get_string_vector
vector< string > get_string_vector(const string &key) const
Definition: parameters.cpp:284
Parameters::fetch_unsigned_long
int fetch_unsigned_long(const string &key, unsigned long &value) const
Definition: parameters.cpp:365
Parameters::fetch_int
int fetch_int(const string &key, int &value) const
Definition: parameters.cpp:346
Parameters::Register_double_vector
void Register_double_vector(const string &key, const vector< double > &defvalue)
Definition: parameters.cpp:478
Bridge::BridgeIO::general
void general(const char *format,...)
Definition: bridgeIO.cpp:200
Parameters::Register_Parameters
void Register_Parameters(const string &key, const Parameters &defvalue)
Definition: parameters.cpp:487
Parameters::Register_double
void Register_double(const string &key, const double defvalue)
Definition: parameters.cpp:469
Bridge::vout
BridgeIO vout
Definition: bridgeIO.cpp:512
Parameters::m_vlevel
Bridge::VerboseLevel m_vlevel
Definition: parameters.h:129
Parameters::fetch_VerboseLevel
int fetch_VerboseLevel(Bridge::VerboseLevel &value) const
Definition: parameters.cpp:461