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/SpaceLoadInstance_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_SPACELOADINSTANCE_IMPL_HPP
7 #define MODEL_SPACELOADINSTANCE_IMPL_HPP
8
9 #include "SpaceLoad_Impl.hpp"
10
11 namespace openstudio {
12 namespace model {
13
14 // forward declaration
15 class SpaceLoadDefinition;
16 class SpaceLoadInstance;
17
18 namespace detail {
19
20 class MODEL_API SpaceLoadInstance_Impl : public SpaceLoad_Impl
21 {
22
23 public:
24 // Construct completely new object.
25 SpaceLoadInstance_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle);
26
27 // Construct from existing workspace object (typically when Model is being constructed
28 // from Workspace).
29 SpaceLoadInstance_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle);
30
31 // Clone copy constructor.
32 SpaceLoadInstance_Impl(const SpaceLoadInstance_Impl& other, Model_Impl* model, bool keepHandle);
33
34 8639 virtual ~SpaceLoadInstance_Impl() override = default;
35
36 /** Returns the definition of this instance. */
37 SpaceLoadDefinition definition() const;
38
39 /** Sets the definition of this instance. */
40 virtual bool setDefinition(const SpaceLoadDefinition& definition) = 0;
41
42 /** Ensures that no other instances share this instances definition. */
43 void makeUnique();
44
45 /** Gets the multiplier for this space instance, defaults to 1. **/
46 virtual double multiplier() const = 0;
47
48 /** Returns true if the multiplier is defaulted. **/
49 virtual bool isMultiplierDefaulted() const = 0;
50
51 /** Returns the floor area associated with this space load instance.
52 If this space load is associated with a single space then that space's floor area is returned.
53 If this space load is associated with a space type then the sum of all space floor area in that space type is returned.
54 Space and SpaceLoadInstance multipliers are included in the result.**/
55 double floorArea() const;
56
57 /** Returns the number of instances this space load instance represents.
58 Space and SpaceLoadInstance multipliers are included in the result **/
59 int quantity() const;
60
61 protected:
62 friend class openstudio::model::SpaceLoadInstance;
63
64 // index of the definition name
65 virtual int definitionIndex() const = 0;
66
67 private:
68 − REGISTER_LOGGER("openstudio.model.SpaceLoadInstance");
69
70 boost::optional<ModelObject> definitionAsModelObject() const;
71
72 bool setDefinitionAsModelObject(const boost::optional<ModelObject>& modelObject);
73 };
74
75 } // namespace detail
76
77 } // namespace model
78 } // namespace openstudio
79
80 #endif // MODEL_SPACELOADINSTANCE_IMPL_HPP
81