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/GasEquipment.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_GASEQUIPMENT_HPP
7 #define MODEL_GASEQUIPMENT_HPP
8
9 #include "ModelAPI.hpp"
10 #include "SpaceLoadInstance.hpp"
11
12 namespace openstudio {
13 namespace model {
14
15 class Schedule;
16 class GasEquipmentDefinition;
17
18 namespace detail {
19
20 class GasEquipment_Impl;
21
22 } // namespace detail
23
24 /** GasEquipment is a SpaceLoadInstance that wraps the OpenStudio IDD object
25 * 'OS:GasEquipment'. \sa GasEquipmentDefinition */
26 class MODEL_API GasEquipment : public SpaceLoadInstance
27 {
28 public:
29 /** @name Constructors and Destructors */
30 //@{
31
32 explicit GasEquipment(const GasEquipmentDefinition& gasEquipmentDefinition);
33
34 144 virtual ~GasEquipment() override = default;
35 // Default the copy and move operators because the virtual dtor is explicit
36 2 GasEquipment(const GasEquipment& other) = default;
37 62 GasEquipment(GasEquipment&& other) = default;
38 ✗ GasEquipment& operator=(const GasEquipment&) = default;
39 ✗ GasEquipment& operator=(GasEquipment&&) = default;
40
41 //@}
42
43 static IddObjectType iddObjectType();
44
45 /** @name Getters */
46 //@{
47
48 /** Gets the GasEquipmentDefinition object. */
49 GasEquipmentDefinition gasEquipmentDefinition() const;
50
51 /** Returns the (fractional) equipment schedule. If this object does not
52 * specify a schedule this function will search the hierarchy. */
53 boost::optional<Schedule> schedule() const;
54
55 /** Returns true if this object does not specify a schedule directly. */
56 bool isScheduleDefaulted() const;
57
58 std::string endUseSubcategory() const;
59
60 bool isEndUseSubcategoryDefaulted() const;
61
62 //@}
63 /** @name Setters */
64 //@{
65
66 /** Sets the GasEquipmentDefinition object. */
67 bool setGasEquipmentDefinition(const GasEquipmentDefinition& definition);
68
69 /** Sets the (fractional) Schedule. */
70 bool setSchedule(Schedule& schedule);
71
72 /** Resets the (fractional) Schedule. */
73 void resetSchedule();
74
75 bool setMultiplier(double multiplier);
76
77 void resetMultiplier();
78
79 bool setEndUseSubcategory(const std::string& endUseSubcategory);
80
81 void resetEndUseSubcategory();
82
83 //@}
84 /** @name Other */
85 //@{
86
87 /** Returns the designLevel if possible based on the underlying data of
88 * gasEquipmentDefinition(). */
89 boost::optional<double> designLevel() const;
90
91 /** Returns the powerPerFloorArea if possible based on the underlying data of
92 * gasEquipmentDefinition(). */
93 boost::optional<double> powerPerFloorArea() const;
94
95 /** Returns the powerPerPerson if possible based on the underlying data of
96 * gasEquipmentDefinition(). */
97 boost::optional<double> powerPerPerson() const;
98
99 /** Returns the design level represented by this instance, assuming floorArea (m^2) and
100 * numPeople. */
101 double getDesignLevel(double floorArea, double numPeople) const;
102
103 /** Returns the watts/m^2 represented by this instance, assuming floorArea (m^2) and
104 * numPeople. */
105 double getPowerPerFloorArea(double floorArea, double numPeople) const;
106
107 /** Returns the watts/person represented by this instance, assuming floorArea (m^2) and
108 * numPeople. */
109 double getPowerPerPerson(double floorArea, double numPeople) const;
110
111 //@}
112 protected:
113 /// @cond
114 using ImplType = detail::GasEquipment_Impl;
115
116 friend class Model;
117 friend class openstudio::IdfObject;
118
119 explicit GasEquipment(std::shared_ptr<detail::GasEquipment_Impl> impl);
120
121 /// @endcond
122 private:
123 REGISTER_LOGGER("openstudio.model.GasEquipment");
124 };
125
126 /** \relates GasEquipment*/
127 using OptionalGasEquipment = boost::optional<GasEquipment>;
128
129 /** \relates GasEquipment*/
130 using GasEquipmentVector = std::vector<GasEquipment>;
131
132 } // namespace model
133 } // namespace openstudio
134
135 #endif // MODEL_GASEQUIPMENT_HPP
136