GCC Code Coverage Report


Directory: ./
Coverage: low: ≥ 0% medium: ≥ 75.0% high: ≥ 90.0%
Coverage Exec / Excl / Total
Lines: 40.0% 2 / 1 / 6
Functions: 40.0% 2 / 1 / 6
Branches: -% 0 / 1 / 1

src/model/SurfacePropertyGroundSurfaces.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_SURFACEPROPERTYGROUNDSURFACES_HPP
7 #define MODEL_SURFACEPROPERTYGROUNDSURFACES_HPP
8
9 #include <model/ModelAPI.hpp>
10 #include "ModelObject.hpp"
11 #include "Schedule.hpp"
12
13 namespace openstudio {
14 namespace model {
15
16 class SurfacePropertyLocalEnvironment;
17
18 namespace detail {
19
20 class SurfacePropertyGroundSurfaces_Impl;
21
22 } // namespace detail
23
24 /** This class implements an extensible group */
25 class MODEL_API GroundSurfaceGroup
26 {
27 public:
28 GroundSurfaceGroup(std::string groundSurfaceName, double viewFactor, boost::optional<Schedule> temperatureSchedule = boost::none,
29 boost::optional<Schedule> reflectanceSchedule = boost::none);
30
31 std::string groundSurfaceName() const;
32 double viewFactor() const;
33 boost::optional<Schedule> temperatureSchedule() const;
34
35 boost::optional<Schedule> reflectanceSchedule() const;
36
37 private:
38 // From
39 std::string m_groundSurfaceName;
40 double m_viewFactor;
41 boost::optional<Schedule> m_temperatureSch;
42 boost::optional<Schedule> m_reflectanceSch;
43 − REGISTER_LOGGER("openstudio.model.GroundSurfaceGroup");
44 };
45
46 // Overload operator<<
47 MODEL_API std::ostream& operator<<(std::ostream& out, const openstudio::model::GroundSurfaceGroup& groundSurfaceGroup);
48
49 /** SurfacePropertyGroundSurfaces is a ModelObject that wraps the OpenStudio IDD object 'OS:SurfaceProperty:GroundSurfaces'. */
50 class MODEL_API SurfacePropertyGroundSurfaces : public ModelObject
51 {
52 public:
53 /** @name Constructors and Destructors */
54 //@{
55
56 explicit SurfacePropertyGroundSurfaces(const Model& model);
57
58 22 virtual ~SurfacePropertyGroundSurfaces() override = default;
59 // Default the copy and move operators because the virtual dtor is explicit
60 ✗ SurfacePropertyGroundSurfaces(const SurfacePropertyGroundSurfaces& other) = default;
61 11 SurfacePropertyGroundSurfaces(SurfacePropertyGroundSurfaces&& other) = default;
62 ✗ SurfacePropertyGroundSurfaces& operator=(const SurfacePropertyGroundSurfaces&) = default;
63 ✗ SurfacePropertyGroundSurfaces& operator=(SurfacePropertyGroundSurfaces&&) = default;
64
65 //@}
66
67 static IddObjectType iddObjectType();
68
69 /** @name Getters */
70 //@{
71
72 //@}
73 /** @name Setters */
74 //@{
75
76 //@}
77 /** @name Other */
78 //@{
79
80 // Helper to get the parent SurfaceProperty:LocalEnvironment object
81 boost::optional<SurfacePropertyLocalEnvironment> surfacePropertyLocalEnvironment() const;
82
83 // Handle this object's extensible fields.
84 std::vector<GroundSurfaceGroup> groundSurfaceGroups() const;
85
86 unsigned int numberofGroundSurfaceGroups() const;
87
88 /** Looks up by Surface Name (case-insensitive) */
89 boost::optional<unsigned> groundSurfaceGroupIndex(const GroundSurfaceGroup& groundSurfaceGroup) const;
90 boost::optional<unsigned> groundSurfaceGroupIndex(const std::string& groundSurfaceName) const;
91
92 boost::optional<GroundSurfaceGroup> getGroundSurfaceGroup(unsigned groupIndex) const;
93
94 /** If a groundSurfaceGroup group is already present (cf `groundSurfaceGroupIndex()`), it will Warn and override the groundSurfaceGroup value */
95 bool addGroundSurfaceGroup(const GroundSurfaceGroup& groundSurfaceGroup);
96
97 // Overloads, it creates a GroundSurfaceGroup wrapper, then call `addGroundSurfaceGroup(const GroundSurfaceGroup& groundSurfaceGroup)`
98 bool addGroundSurfaceGroup(const std::string& groundSurfaceName, double viewFactor, boost::optional<Schedule> temperatureSchedule = boost::none,
99 boost::optional<Schedule> reflectanceSchedule = boost::none);
100
101 bool addGroundSurfaceGroups(const std::vector<GroundSurfaceGroup>& groundSurfaceGroups);
102
103 bool removeGroundSurfaceGroup(unsigned groupIndex);
104
105 void removeAllGroundSurfaceGroups();
106
107 //@}
108 protected:
109 /// @cond
110 using ImplType = detail::SurfacePropertyGroundSurfaces_Impl;
111
112 explicit SurfacePropertyGroundSurfaces(std::shared_ptr<detail::SurfacePropertyGroundSurfaces_Impl> impl);
113
114 friend class detail::SurfacePropertyGroundSurfaces_Impl;
115 friend class Model;
116 friend class IdfObject;
117 friend class openstudio::detail::IdfObject_Impl;
118 /// @endcond
119 private:
120 REGISTER_LOGGER("openstudio.model.SurfacePropertyGroundSurfaces");
121 };
122
123 /** \relates SurfacePropertyGroundSurfaces*/
124 using OptionalSurfacePropertyGroundSurfaces = boost::optional<SurfacePropertyGroundSurfaces>;
125
126 /** \relates SurfacePropertyGroundSurfaces*/
127 using SurfacePropertyGroundSurfacesVector = std::vector<SurfacePropertyGroundSurfaces>;
128
129 } // namespace model
130 } // namespace openstudio
131
132 #endif // MODEL_SURFACEPROPERTYGROUNDSURFACES_HPP
133