Bridge++  Ver. 1.3.x
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 <iostream>
21 
23 
31 {
32  public:
33  static const std::string class_name;
34 
36 
38  void read_params(const std::string& params_file, Parameters *params);
39 
41  void read_params(const std::string& params_file, unique_ptr<Parameters>& params) { return ParameterManager::read_params(params_file, params); }
42 
44  void read_params(std::istream&, Parameters *params);
45 
46  private:
47 
49  int set_key_and_value(std::string& keystr, std::string& valstr, std::string& line);
50 
52  int remove_space(std::string&);
53 
55  void convert_int_vector(std::vector<int>& vec, std::string& valstr);
56 
58  void convert_double_vector(std::vector<double>& vec, std::string& valstr);
59 };
60 #endif
virtual void read_params(const std::string &params_file, Parameters *params)=0
void read_params(const std::string &params_file, Parameters *params)
read parameters from file.
int remove_space(std::string &)
remove spaces from both side of a string.
void read_params(const std::string &params_file, unique_ptr< Parameters > &params)
read parameters from file.
void convert_double_vector(std::vector< double > &vec, std::string &valstr)
convert from string to double vector.
Class for parameters.
Definition: parameters.h:38
static const std::string class_name
void convert_int_vector(std::vector< int > &vec, std::string &valstr)
convert from string to int vector.
int set_key_and_value(std::string &keystr, std::string &valstr, std::string &line)
extract key and value from a given line.
Parameter manager with YAML parser.
Base class of parameter manager.