GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 60.0% 3 / 0 / 5
Functions: 60.0% 3 / 0 / 5
Branches: -% 0 / 0 / 0

src/model/TableLookup.hpp
Line Branch Exec Source
1 /***********************************************************************************************************************
2 * OpenStudio(R), Copyright (c) Alliance for Energy Innovation, LLC.
3 * See also https://openstudio.net/license
4 ***********************************************************************************************************************/
5
6 #ifndef MODEL_TABLELOOKUP_HPP
7 #define MODEL_TABLELOOKUP_HPP
8
9 #include "ModelAPI.hpp"
10 #include "Curve.hpp"
11
12 namespace openstudio {
13 namespace model {
14
15 class ModelObjectList;
16 class TableIndependentVariable;
17
18 namespace detail {
19
20 class TableLookup_Impl;
21
22 } // namespace detail
23
24 /** TableLookup is a Curve that wraps the OpenStudio IDD object 'OS:Table:Lookup'. */
25 class MODEL_API TableLookup : public Curve
26 {
27 public:
28 /** @name Constructors and Destructors */
29 //@{
30
31 /** Create a TableLookup object with the specified number
32 * of independent variables.
33 */
34 explicit TableLookup(const Model& model);
35
36 230 virtual ~TableLookup() override = default;
37 // Default the copy and move operators because the virtual dtor is explicit
38 5 TableLookup(const TableLookup& other) = default;
39 58 TableLookup(TableLookup&& other) = default;
40 ✗ TableLookup& operator=(const TableLookup&) = default;
41 ✗ TableLookup& operator=(TableLookup&&) = default;
42
43 //@}
44
45 static IddObjectType iddObjectType();
46
47 static std::vector<std::string> normalizationMethodValues();
48 static std::vector<std::string> validNormalizationMethodValues();
49
50 static std::vector<std::string> outputUnitTypeValues();
51 static std::vector<std::string> validOutputUnitTypeValues();
52
53 /** @name Getters */
54 //@{
55
56 std::string normalizationMethod() const;
57
58 double normalizationDivisor() const;
59
60 boost::optional<double> minimumOutput() const;
61
62 boost::optional<double> maximumOutput() const;
63
64 std::string outputUnitType() const;
65
66 //@}
67 /** @name Setters */
68 //@{
69
70 bool setNormalizationMethod(const std::string& normalizationMethod);
71
72 bool setNormalizationDivisor(double normalizationDivisor);
73
74 bool setMinimumOutput(double minimumOutput);
75 void resetMinimumOutput();
76
77 bool setMaximumOutput(double maximumOutput);
78 void resetMaximumOutput();
79
80 bool setOutputUnitType(const std::string& outputUnitType);
81
82 //@}
83 /** @name Other */
84 //@{
85
86 bool addOutputValue(double outputValue);
87 bool removeOutputValue(unsigned groupIndex);
88 void removeAllOutputValues();
89 std::vector<double> outputValues() const;
90 unsigned numberofOutputValues() const;
91 // Directly set the Output Values from a vector, will delete any existing Output Values
92 bool setOutputValues(const std::vector<double>& outputValues);
93
94 bool addIndependentVariable(const TableIndependentVariable& tableIndependentVariable);
95 bool removeIndependentVariable(const TableIndependentVariable& tableIndependentVariable);
96 void removeAllIndependentVariables();
97 std::vector<TableIndependentVariable> independentVariables() const;
98
99 //@}
100 protected:
101 /// @cond
102 using ImplType = detail::TableLookup_Impl;
103
104 explicit TableLookup(std::shared_ptr<detail::TableLookup_Impl> impl);
105
106 friend class detail::TableLookup_Impl;
107 friend class Model;
108 friend class IdfObject;
109 friend class openstudio::detail::IdfObject_Impl;
110 /// @endcond
111 private:
112 REGISTER_LOGGER("openstudio.model.TableLookup");
113 };
114
115 /** \relates TableLookup*/
116 using OptionalTableLookup = boost::optional<TableLookup>;
117
118 /** \relates TableLookup*/
119 using TableLookupVector = std::vector<TableLookup>;
120
121 } // namespace model
122 } // namespace openstudio
123
124 #endif // MODEL_TABLELOOKUP_HPP
125