Bridge++  Ver. 1.2.x
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
parameterManager_YAML.h
Go to the documentation of this file.
1 
14 #ifndef PARAMETERMANAGER_YAML_INCLUDED
15 #define PARAMETERMANAGER_YAML_INCLUDED
16 
17 #include "parameterManager.h"
18 
19 #include <string>
20 #include <valarray>
21 #include <iostream>
22 
24 
32 {
33  public:
34 
36 
38  void read_params(const std::string& params_file, Parameters *params);
39 
41  void read_params(std::istream&, Parameters *params);
42 
43  private:
44 
46  int set_key_and_value(std::string& keystr, std::string& valstr, std::string& line);
47 
49  int remove_space(std::string&);
50 
52  void convert_int_vector(std::valarray<int>& vec, std::string& valstr);
53 
55  void convert_double_vector(std::valarray<double>& vec, std::string& valstr);
56 };
57 #endif
void read_params(const std::string &params_file, Parameters *params)
read parameters from file.
void convert_double_vector(std::valarray< double > &vec, std::string &valstr)
convert from string to double vector.
int remove_space(std::string &)
remove spaces from both side of a string.
Class for parameters.
Definition: parameters.h:40
int set_key_and_value(std::string &keystr, std::string &valstr, std::string &line)
extract key and value from a given line.
void convert_int_vector(std::valarray< int > &vec, std::string &valstr)
convert from string to int vector.
Parameter manager with YAML parser.
Base class of parameter manager.