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/WaterToWaterComponent.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_WATERTOWATERCOMPONENT_HPP
7 #define MODEL_WATERTOWATERCOMPONENT_HPP
8
9 #include "ModelAPI.hpp"
10 #include "HVACComponent.hpp"
11 #include "Connection.hpp"
12
13 namespace openstudio {
14 namespace model {
15
16 class AirLoopHVAC;
17
18 namespace detail {
19 class WaterToWaterComponent_Impl;
20 }
21
22 /** WaterToWaterComponent is the base class for HVACComponent objects which interact with two water loops. A WaterToWaterComponent
23 * has two inlet nodes and two outlet ports. One pair of inlet/outlet ports is designated as the supply side and the other pair
24 * is designated as the demand side.
25 */
26 class MODEL_API WaterToWaterComponent : public HVACComponent
27 {
28 public:
29 WaterToWaterComponent(IddObjectType type, const Model& model);
30
31 2999 virtual ~WaterToWaterComponent() override = default;
32 // Default the copy and move operators because the virtual dtor is explicit
33 187 WaterToWaterComponent(const WaterToWaterComponent& other) = default;
34 1257 WaterToWaterComponent(WaterToWaterComponent&& other) = default;
35 ✗ WaterToWaterComponent& operator=(const WaterToWaterComponent&) = default;
36 ✗ WaterToWaterComponent& operator=(WaterToWaterComponent&&) = default;
37
38 /** Returns the supply inlet port. **/
39 virtual unsigned supplyInletPort() const;
40
41 /** Returns the supply outlet port. **/
42 virtual unsigned supplyOutletPort() const;
43
44 /** Returns the demand inlet port. **/
45 virtual unsigned demandInletPort() const;
46
47 /** Returns the demand outlet port. **/
48 virtual unsigned demandOutletPort() const;
49
50 /** Returns the optional ModelObject connected to the supply inlet port. **/
51 virtual boost::optional<ModelObject> supplyInletModelObject() const;
52
53 /** Returns the optional ModelObject connected to the supply outlet port. **/
54 virtual boost::optional<ModelObject> supplyOutletModelObject() const;
55
56 /** Returns the optional ModelObject connected to the demand inlet port. **/
57 virtual boost::optional<ModelObject> demandInletModelObject() const;
58
59 /** Returns the optional ModelObject connected to the demand outlet port. **/
60 virtual boost::optional<ModelObject> demandOutletModelObject() const;
61
62 virtual bool addToNode(Node& node);
63
64 virtual std::vector<openstudio::IdfObject> remove();
65
66 virtual ModelObject clone(Model model) const;
67
68 /** Returns the optional PlantLoop object that the HVAC component is a supply component on.
69 */
70 boost::optional<PlantLoop> plantLoop() const; // cppcheck-suppress [duplInheritedMember] for documentation purposes
71
72 /** Returns the optional PlantLoop object that the HVAC component is a demand component on.
73 */
74 boost::optional<PlantLoop> secondaryPlantLoop() const; // cppcheck-suppress [duplInheritedMember] for documentation purposes
75
76 /** Removes the component from the plantLoop if one is attached.
77 * Repairs the plantLoop connections preserving the integrity of the loop.
78 */
79 bool removeFromPlantLoop();
80
81 /** Removes the component from the secondaryPlantLoop if one is attached.
82 * Repairs the secondaryPlantLoop connections preserving the integrity of the loop.
83 */
84 bool removeFromSecondaryPlantLoop();
85
86 /** Tertiary plant loop applies to a limited number of WaterToWaterComponent types that
87 * interact with three plant systems. One example is a water cooled chiller with heat recovery,
88 * which can be connected to a chilled water, condenser, and heat recovery plant simultaneously.
89 */
90 boost::optional<PlantLoop> tertiaryPlantLoop() const;
91
92 /** Removes the component from the tertiaryPlantLoop if one is attached.
93 * Repairs the tertiaryPlantLoop connections preserving the integrity of the loop.
94 */
95 bool removeFromTertiaryPlantLoop();
96
97 /** Add this WaterToWaterComponent to a tertiaryPlantLoop by making connections to the
98 * tertiary inlet and outlet.
99 */
100 virtual bool addToTertiaryNode(Node& node);
101
102 /** Returns the optional ModelObject connected to the tertiary inlet. **/
103 boost::optional<ModelObject> tertiaryInletModelObject() const;
104
105 /** Returns the optional ModelObject connected to the tertiary outlet. **/
106 boost::optional<ModelObject> tertiaryOutletModelObject() const;
107
108 protected:
109 friend class Model;
110
111 friend class openstudio::IdfObject;
112
113 /// @cond
114
115 using ImplType = detail::WaterToWaterComponent_Impl;
116
117 explicit WaterToWaterComponent(std::shared_ptr<detail::WaterToWaterComponent_Impl> impl);
118
119 private:
120 REGISTER_LOGGER("openstudio.model.WaterToWaterComponent");
121
122 /// @endcond
123 };
124
125 using OptionalWaterToWaterComponent = boost::optional<WaterToWaterComponent>;
126
127 } // namespace model
128
129 } // namespace openstudio
130
131 #endif // MODEL_WATERTOWATERCOMPONENT_HPP
132