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/SpaceLoad.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_SPACELOAD_HPP
7 #define MODEL_SPACELOAD_HPP
8
9 #include "ModelAPI.hpp"
10 #include "SpaceItem.hpp"
11
12 namespace openstudio {
13 namespace model {
14
15 class SpaceType;
16
17 namespace detail {
18 class SpaceLoad_Impl;
19 }
20
21 /** SpaceLoad is an abstract class derived from SpaceItem.
22 */
23 class MODEL_API SpaceLoad : public SpaceItem
24 {
25 public:
26 12829 virtual ~SpaceLoad() override = default;
27 // Default the copy and move operators because the virtual dtor is explicit
28 444 SpaceLoad(const SpaceLoad& other) = default;
29 5252 SpaceLoad(SpaceLoad&& other) = default;
30 ✗ SpaceLoad& operator=(const SpaceLoad&) = default;
31 398 SpaceLoad& operator=(SpaceLoad&&) = default;
32
33 /// Returns the parent SpaceType.
34 boost::optional<SpaceType> spaceType() const;
35
36 /// Sets the parent SpaceType.
37 bool setSpaceType(const SpaceType& spaceType);
38
39 void resetSpaceType();
40
41 /// Converts space load levels to absolute values rather than by per area, etc.
42 /// Also hard sizes any costs associated with this load.
43 /// Only possible if this space load is parented by a space, returns false if
44 /// parented by a space type.
45 bool hardSize();
46
47 /// Directly applies default schedules to this space load if found.
48 bool hardApplySchedules();
49
50 /// Returns true if the load represents an absolute quantity that must be added when combining space types
51 bool isAbsolute() const;
52
53 protected:
54 /** @name Constructors and Destructors */
55 //@{
56
57 /// Constructs a new SpaceLoad object in the model.
58 SpaceLoad(IddObjectType type, const Model& model);
59
60 //@}
61
62 /// @cond
63
64 using ImplType = detail::SpaceLoad_Impl;
65
66 friend class Model;
67 friend class openstudio::IdfObject;
68 friend class detail::SpaceLoad_Impl;
69
70 explicit SpaceLoad(std::shared_ptr<detail::SpaceLoad_Impl> impl);
71
72 private:
73 REGISTER_LOGGER("openstudio.model.SpaceLoad");
74
75 /// @endcond
76 };
77
78 /** \relates SpaceLoad */
79 using OptionalSpaceLoad = boost::optional<SpaceLoad>;
80
81 /** \relates SpaceLoad */
82 using SpaceLoadVector = std::vector<SpaceLoad>;
83
84 } // namespace model
85 } // namespace openstudio
86
87 #endif // MODEL_SPACELOAD_HPP
88