TBTK
ParameterSet.h
Go to the documentation of this file.
1 /* Copyright 2016 Kristofer Bj√∂rnson and Andreas Theiler
2  *
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  * http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
24 #ifndef COM_DAFER45_TBTK_PARAMETER_SET
25 #define COM_DAFER45_TBTK_PARAMETER_SET
26 
27 #include <vector>
28 #include <tuple>
29 #include <string>
30 #include <complex>
31 
32 namespace TBTK{
33 
35 public:
37  ParameterSet();
38 
40  ~ParameterSet();
41 
43  void addInt(std::string name, int value);
44 
46  void addDouble(std::string name, double value);
47 
49  void addComplex(std::string name, std::complex<double> value);
50 
52  void addString(std::string name, std::string value);
53 
55  void addBool(std::string name, bool value);
56 
58  void setInt(std::string name, int value);
59 
61  void setDouble(std::string name, double value);
62 
64  void setComplex(std::string name, std::complex<double> value);
65 
67  void setString(std::string name, std::string value);
68 
70  void setBool(std::string name, bool value);
71 
73  int getInt(std::string name) const;
74 
76  double getDouble(std::string name) const;
77 
79  std::complex<double> getComplex(std::string name) const;
80 
82  std::string getString(std::string name) const;
83 
85  bool getBool(std::string name) const;
86 
88  int getNumInt() const;
89 
91  int getNumDouble() const;
92 
94  int getNumComplex() const;
95 
97  int getNumString() const;
98 
100  int getNumBool() const;
101 
103  std::string getIntName(int n) const;
104 
106  std::string getDoubleName(int n) const;
107 
109  std::string getComplexName(int n) const;
110 
112  std::string getStringName(int n) const;
113 
115  std::string getBoolName(int n) const;
116 
118  int getIntValue(int n) const;
119 
121  double getDoubleValue(int n) const;
122 
124  std::complex<double> getComplexValue(int n) const;
125 
127  std::string getStringValue(int n) const;
128 
130  bool getBoolValue(int n) const;
131 
133  bool intExists(std::string name) const;
134 
136  bool doubleExists(std::string name) const;
137 
139  bool complexExists(std::string name) const;
140 
142  bool stringExists(std::string name) const;
143 
145  bool boolExists(std::string name) const;
146 private:
148  std::vector<std::tuple<std::string, int>> intParams;
149 
151  std::vector<std::tuple<std::string, double>> doubleParams;
152 
154  std::vector<std::tuple<std::string, std::complex<double>>> complexParams;
155 
157  std::vector<std::tuple<std::string, std::string>> stringParams;
158 
160  std::vector<std::tuple<std::string, bool>> boolParams;
161 };
162 
163 }; //End of namespace TBTK
164 
165 #endif
std::complex< double > getComplex(std::string name) const
std::string getStringName(int n) const
void addString(std::string name, std::string value)
void addBool(std::string name, bool value)
bool complexExists(std::string name) const
std::string getBoolName(int n) const
std::string getIntName(int n) const
int getNumComplex() const
void setBool(std::string name, bool value)
int getNumString() const
void setInt(std::string name, int value)
bool doubleExists(std::string name) const
int getNumDouble() const
bool getBoolValue(int n) const
int getNumInt() const
bool boolExists(std::string name) const
void addDouble(std::string name, double value)
void setComplex(std::string name, std::complex< double > value)
std::string getComplexName(int n) const
std::string getDoubleName(int n) const
int getNumBool() const
std::string getString(std::string name) const
void addComplex(std::string name, std::complex< double > value)
Definition: ModelFactory.h:35
Definition: ParameterSet.h:34
void addInt(std::string name, int value)
bool stringExists(std::string name) const
int getInt(std::string name) const
void setDouble(std::string name, double value)
int getIntValue(int n) const
double getDoubleValue(int n) const
bool getBool(std::string name) const
double getDouble(std::string name) const
void setString(std::string name, std::string value)
bool intExists(std::string name) const
std::string getStringValue(int n) const
std::complex< double > getComplexValue(int n) const