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/ExteriorLoadInstance.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_EXTERIORLOADINSTANCE_HPP
7 #define MODEL_EXTERIORLOADINSTANCE_HPP
8
9 #include "ModelAPI.hpp"
10 #include "ModelObject.hpp"
11
12 namespace openstudio {
13 namespace model {
14
15 class ExteriorLoadDefinition;
16
17 namespace detail {
18 class ExteriorLoadInstance_Impl;
19 }
20
21 /** ExteriorLoadInstance is an abstract class derived from ModelObject. \link ExteriorLoadInstance
22 * ExteriorLoadInstances \endlink instantiate a given ExteriorLoadDefinition in the facility
23 * by defining a multiplier and a schedule.
24 */
25 class MODEL_API ExteriorLoadInstance : public ModelObject
26 {
27 public:
28 154 virtual ~ExteriorLoadInstance() override = default;
29 // Default the copy and move operators because the virtual dtor is explicit
30 18 ExteriorLoadInstance(const ExteriorLoadInstance& other) = default;
31 49 ExteriorLoadInstance(ExteriorLoadInstance&& other) = default;
32 ✗ ExteriorLoadInstance& operator=(const ExteriorLoadInstance&) = default;
33 ✗ ExteriorLoadInstance& operator=(ExteriorLoadInstance&&) = default;
34
35 /** Returns the definition of this instance. **/
36 ExteriorLoadDefinition definition() const;
37
38 /** Sets the definition of this instance. **/
39 bool setDefinition(const ExteriorLoadDefinition& definition);
40
41 /** Ensures that no other instances share this instances definition. **/
42 void makeUnique();
43
44 /** Gets the multiplier for this space instance, defaults to 1. **/
45 double multiplier() const;
46
47 /** Returns true if the multiplier is defaulted. **/
48 bool isMultiplierDefaulted() const;
49
50 /** Returns the number of instances this space load instance represents.
51 This just forwards to multiplier() here but is included for consistency with SpaceLoadInstance**/
52 int quantity() const;
53
54 protected:
55 /** @name Constructors and Destructors */
56 //@{
57
58 /// Constructs a new ExteriorLoadInstance object in the model.
59 ExteriorLoadInstance(IddObjectType type, const ExteriorLoadDefinition& definition);
60
61 //@}
62
63 /// @cond
64
65 using ImplType = detail::ExteriorLoadInstance_Impl;
66
67 friend class Model;
68 friend class openstudio::IdfObject;
69 friend class detail::ExteriorLoadInstance_Impl;
70
71 explicit ExteriorLoadInstance(std::shared_ptr<detail::ExteriorLoadInstance_Impl> impl);
72
73 private:
74 REGISTER_LOGGER("openstudio.model.ExteriorLoadInstance");
75
76 /// @endcond
77 };
78
79 /** \relates ExteriorLoadInstance */
80 using OptionalExteriorLoadInstance = boost::optional<ExteriorLoadInstance>;
81
82 /** \relates ExteriorLoadInstance */
83 using ExteriorLoadInstanceVector = std::vector<ExteriorLoadInstance>;
84
85 } // namespace model
86 } // namespace openstudio
87
88 #endif // MODEL_EXTERIORLOADINSTANCE_HPP
89