GCC Code Coverage Report


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

src/model/CurveQuadratic.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_CURVEQUADRATIC_HPP
7 #define MODEL_CURVEQUADRATIC_HPP
8
9 #include "ModelAPI.hpp"
10 #include "Curve.hpp"
11
12 namespace openstudio {
13 namespace model {
14
15 namespace detail {
16
17 class CurveQuadratic_Impl;
18
19 } // namespace detail
20
21 /** CurveQuadratic is a Curve that wraps the OpenStudio IDD object 'OS:Curve:Quadratic'. The
22 * functional form is \f$f(x) = c_1 + c_2 \cdot x + c_3 \cdot x^2\f$ */
23 class MODEL_API CurveQuadratic : public Curve
24 {
25 public:
26 /** @name Constructors and Destructors */
27 //@{
28
29 /** Initializes \f$c_1 = c_2 = 0.0,\ c_3 = 1.0,\ xmin = 0,\ xmax = 1\f$ */
30 explicit CurveQuadratic(const Model& model);
31
32 3836 virtual ~CurveQuadratic() override = default;
33 // Default the copy and move operators because the virtual dtor is explicit
34 23 CurveQuadratic(const CurveQuadratic& other) = default;
35 262 CurveQuadratic(CurveQuadratic&& other) = default;
36 ✗ CurveQuadratic& operator=(const CurveQuadratic&) = default;
37 31 CurveQuadratic& operator=(CurveQuadratic&&) = default;
38
39 //@}
40
41 static IddObjectType iddObjectType();
42
43 static std::vector<std::string> validInputUnitTypeforXValues();
44
45 static std::vector<std::string> validOutputUnitTypeValues();
46
47 /** @name Getters */
48 //@{
49
50 double coefficient1Constant() const;
51
52 double coefficient2x() const;
53
54 double coefficient3xPOW2() const;
55
56 double minimumValueofx() const;
57
58 double maximumValueofx() const;
59
60 boost::optional<double> minimumCurveOutput() const;
61
62 boost::optional<double> maximumCurveOutput() const;
63
64 std::string inputUnitTypeforX() const;
65
66 bool isInputUnitTypeforXDefaulted() const;
67
68 std::string outputUnitType() const;
69
70 bool isOutputUnitTypeDefaulted() const;
71
72 //@}
73 /** @name Setters */
74 //@{
75
76 bool setCoefficient1Constant(double coefficient1Constant);
77
78 bool setCoefficient2x(double coefficient2x);
79
80 bool setCoefficient3xPOW2(double coefficient3xPOW2);
81
82 bool setMinimumValueofx(double minimumValueofx);
83
84 bool setMaximumValueofx(double maximumValueofx);
85
86 bool setMinimumCurveOutput(double minimumCurveOutput);
87
88 void resetMinimumCurveOutput();
89
90 bool setMaximumCurveOutput(double maximumCurveOutput);
91
92 void resetMaximumCurveOutput();
93
94 bool setInputUnitTypeforX(const std::string& inputUnitTypeforX);
95
96 void resetInputUnitTypeforX();
97
98 bool setOutputUnitType(const std::string& outputUnitType);
99
100 void resetOutputUnitType();
101
102 //@}
103 /** @name Other */
104 //@{
105
106 //@}
107 protected:
108 /// @cond
109 using ImplType = detail::CurveQuadratic_Impl;
110
111 explicit CurveQuadratic(std::shared_ptr<detail::CurveQuadratic_Impl> impl);
112
113 friend class detail::CurveQuadratic_Impl;
114 friend class Model;
115 friend class IdfObject;
116 friend class openstudio::detail::IdfObject_Impl;
117
118 /// @endcond
119 private:
120 REGISTER_LOGGER("openstudio.model.CurveQuadratic");
121 };
122
123 /** \relates CurveQuadratic*/
124 using OptionalCurveQuadratic = boost::optional<CurveQuadratic>;
125
126 /** \relates CurveQuadratic*/
127 using CurveQuadraticVector = std::vector<CurveQuadratic>;
128
129 } // namespace model
130 } // namespace openstudio
131
132 #endif // MODEL_CURVEQUADRATIC_HPP
133