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/ThermochromicGlazing.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_THERMOCHROMICGLAZING_HPP
7 #define MODEL_THERMOCHROMICGLAZING_HPP
8
9 #include "ModelAPI.hpp"
10 #include "Glazing.hpp"
11 #include "StandardGlazing.hpp"
12
13 namespace openstudio {
14 namespace model {
15
16 namespace detail {
17
18 class ThermochromicGlazing_Impl;
19
20 } // namespace detail
21
22 /** This class implements a Thermochromic Group */
23 class MODEL_API ThermochromicGroup
24 {
25 public:
26 /* Only accepts ModelObjects that are of type Surface, Subsurface or InternalMass, will throw otherwise */
27 ThermochromicGroup(const StandardGlazing& standardGlazing, double opticalDataTemperature);
28
29 StandardGlazing standardGlazing() const;
30 double opticalDataTemperature() const;
31
32 // Equality is defined as having the same StandardGlazing **OR** has having equal opticalDataTemperature with epsilon tolerance
33 // Meaning we enforce both unitcity of StandardGlazing and opticalDataTemperature
34 bool operator==(const ThermochromicGroup& other) const;
35 bool operator!=(const ThermochromicGroup& other) const;
36
37 // Sort order is defined by the opticalDataTemperature only, used in FT to ensure that the groups are sorted by temperature
38 bool operator<(const ThermochromicGroup& other) const;
39 bool operator>(const ThermochromicGroup& other) const;
40 bool operator<=(const ThermochromicGroup& other) const;
41 bool operator>=(const ThermochromicGroup& other) const;
42
43 private:
44 // From
45 StandardGlazing m_standardGlazing;
46 double m_opticalDataTemperature;
47 REGISTER_LOGGER("openstudio.model.ThermochromicGroup");
48 };
49
50 // Overload operator<<
51 MODEL_API std::ostream& operator<<(std::ostream& out, const openstudio::model::ThermochromicGroup& thermochromicGroup);
52
53 /** ThermochromicGlazing is a Glazing that wraps the OpenStudio IDD object 'OS:WindowMaterial:GlazingGroup:Thermochromic'. */
54 class MODEL_API ThermochromicGlazing : public Glazing
55 {
56 public:
57 /** @name Constructors and Destructors */
58 //@{
59
60 explicit ThermochromicGlazing(const Model& model);
61
62 14 virtual ~ThermochromicGlazing() override = default;
63 // Default the copy and move operators because the virtual dtor is explicit
64 ✗ ThermochromicGlazing(const ThermochromicGlazing& other) = default;
65 2 ThermochromicGlazing(ThermochromicGlazing&& other) = default;
66 1 ThermochromicGlazing& operator=(const ThermochromicGlazing&) = default;
67 ✗ ThermochromicGlazing& operator=(ThermochromicGlazing&&) = default;
68
69 //@}
70
71 static IddObjectType iddObjectType();
72
73 /** @name Getters */
74 //@{
75
76 //@}
77 /** @name Setters */
78 //@{
79
80 //@}
81 /** @name Other */
82 //@{
83
84 // Handle this object's extensible fields.
85
86 std::vector<ThermochromicGroup> thermochromicGroups() const;
87
88 unsigned int numberofThermochromicGroups() const;
89
90 boost::optional<unsigned> thermochromicGroupIndex(const ThermochromicGroup& thermochromicGroup) const;
91 boost::optional<ThermochromicGroup> getThermochromicGroup(unsigned groupIndex) const;
92
93 bool addThermochromicGroup(const ThermochromicGroup& thermochromicGroup);
94
95 // Convenience fucntion that will create a ThermochromicGroup
96 bool addThermochromicGroup(const StandardGlazing& standardGlazing, double opticalDataTemperature);
97
98 bool addThermochromicGroups(const std::vector<ThermochromicGroup>& thermochromicGroups);
99 bool removeThermochromicGroup(unsigned groupIndex);
100 void removeAllThermochromicGroups();
101
102 //@}
103 protected:
104 /// @cond
105 using ImplType = detail::ThermochromicGlazing_Impl;
106
107 explicit ThermochromicGlazing(std::shared_ptr<detail::ThermochromicGlazing_Impl> impl);
108
109 friend class detail::ThermochromicGlazing_Impl;
110 friend class Model;
111 friend class IdfObject;
112 friend class openstudio::detail::IdfObject_Impl;
113 /// @endcond
114 private:
115 REGISTER_LOGGER("openstudio.model.ThermochromicGlazing");
116 };
117
118 /** \relates ThermochromicGlazing*/
119 using OptionalThermochromicGlazing = boost::optional<ThermochromicGlazing>;
120
121 /** \relates ThermochromicGlazing*/
122 using ThermochromicGlazingVector = std::vector<ThermochromicGlazing>;
123
124 } // namespace model
125 } // namespace openstudio
126
127 #endif // MODEL_THERMOCHROMICGLAZING_HPP
128