GCC Code Coverage Report


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

src/model/InternalMassDefinition_Impl.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_INTERNALMASSDEFINITION_IMPL_HPP
7 #define MODEL_INTERNALMASSDEFINITION_IMPL_HPP
8
9 #include "ModelAPI.hpp"
10 #include "SpaceLoadDefinition_Impl.hpp"
11
12 namespace openstudio {
13 namespace model {
14
15 class ConstructionBase;
16 class InternalMassDefinition;
17
18 namespace detail {
19
20 /** InternalMassDefinition_Impl is a SpaceLoadDefinition_Impl that is the implementation class for InternalMassDefinition.*/
21 class MODEL_API InternalMassDefinition_Impl : public SpaceLoadDefinition_Impl
22 {
23
24 public:
25 /** @name Constructors and Destructors */
26 //@{
27
28 InternalMassDefinition_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle);
29
30 InternalMassDefinition_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle);
31
32 InternalMassDefinition_Impl(const InternalMassDefinition_Impl& other, Model_Impl* model, bool keepHandle);
33
34 169 virtual ~InternalMassDefinition_Impl() override = default;
35
36 //@}
37 /** @name Virtual Methods */
38 //@{
39
40 virtual const std::vector<std::string>& outputVariableNames() const override;
41
42 virtual IddObjectType iddObjectType() const override;
43
44 //@}
45 /** @name Getters */
46 //@{
47
48 /// Returns the construction object, if this object does not directly specify construction the hierarchy is searched.
49 boost::optional<ConstructionBase> construction() const;
50
51 /// Returns true if the construction is not directly referenced by this surface .
52 bool isConstructionDefaulted() const;
53
54 std::string designLevelCalculationMethod() const;
55 boost::optional<double> surfaceArea() const;
56 boost::optional<double> surfaceAreaperSpaceFloorArea() const;
57 boost::optional<double> surfaceAreaperPerson() const;
58
59 //@}
60 /** @name Setters */
61 //@{
62
63 /// Sets the construction object.
64 bool setConstruction(const ConstructionBase& construction);
65
66 /// Resets the construction object.
67 void resetConstruction();
68
69 /// Sets designLevelCalculationMethod to 'SurfaceArea', clears surfaceAreaperSpaceFloorArea
70 /// and surfaceAreaperPerson, and sets surfaceArea.
71 bool setSurfaceArea(boost::optional<double> surfaceArea);
72
73 /// Sets designLevelCalculationMethod to 'SurfaceArea/Area', clears surfaceArea
74 /// and surfaceAreaperPerson, and sets surfaceAreaperSpaceFloorArea.
75 bool setSurfaceAreaperSpaceFloorArea(boost::optional<double> surfaceAreaperSpaceFloorArea);
76
77 /// Sets designLevelCalculationMethod to 'SurfaceArea/Person', clears surfaceArea
78 /// and surfaceAreaperSpaceFloorArea, and sets surfaceAreaperPerson.
79 bool setSurfaceAreaperPerson(boost::optional<double> surfaceAreaperPerson);
80
81 //@}
82 /** @name Other */
83 //@{
84
85 /** Returns the construction surface area represented by this definition, assuming floorArea
86 * (m^2) and numPeople. */
87 double getSurfaceArea(double floorArea, double numPeople) const;
88
89 /** Returns the m^2/m^2 of construction surface area per floor area represented by this
90 * definition, assuming floorArea (m^2) and numPeople. */
91 double getSurfaceAreaPerFloorArea(double floorArea, double numPeople) const;
92
93 /** Returns the m^2/person of construction surface area represented by this definition, assuming
94 * floorArea (m^2) and numPeople. */
95 double getSurfaceAreaPerPerson(double floorArea, double numPeople) const;
96
97 /** If method is a \link validDesignLevelCalculationMethodValues valid design level calculation
98 * method \endlink, changes this definition to an equivalent construction surface area, under
99 * the assumptions of floorArea (m^2) and numPeople. */
100 bool setDesignLevelCalculationMethod(const std::string& method, double floorArea, double numPeople);
101
102 //@}
103 protected:
104 private:
105 − REGISTER_LOGGER("openstudio.model.InternalMassDefinition");
106
107 boost::optional<ModelObject> constructionAsModelObject() const;
108
109 bool setConstructionAsModelObject(const boost::optional<ModelObject>& modelObject);
110 };
111
112 } // namespace detail
113
114 } // namespace model
115 } // namespace openstudio
116
117 #endif // MODEL_INTERNALMASSDEFINITION_IMPL_HPP
118