TCPSPSuite
parameter.hpp
1 #ifndef PARAMETER_H
2 #define PARAMETER_H
3 
4 #include <string> // for string, allocator
5 #include <vector> // for vector
6 #include <json.hpp> // for json
7 
8 using json = nlohmann::json;
9 
10 class Parameter {
11 public:
12 
13  Parameter(std::string name, int minValue, int maxValue, int stepSize);
14  Parameter(std::string name, double minValue, double maxValue, double stepSize);
15  Parameter(std::string name, bool value, bool fixed);
16  Parameter(std::string name, json array);
17 
18  std::string getName();
19  json getCurrentValue();
20  bool isLastValue();
21  void nextValue();
22 
23 private:
24  enum class type {integerValue, doubleValue, booleanValue, arrayValue};
25 
26  std::string parameterName;
27  type valueType;
28 
29  int currentInt;
30  int stepInt;
31  int minInt;
32  int maxInt;
33 
34  double currentDouble;
35  double stepDouble;
36  double minDouble;
37  double maxDouble;
38 
39  bool currentBoolean;
40  bool stepBoolean;
41  bool maxBoolean;
42 
43  json arrayValues;
44  size_t currentIndex;
45 
46 };
47 
48 #endif