GCC Code Coverage Report


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

src/model/WaterToWaterComponent_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_WATERTOWATERCOMPONENT_IMPL_HPP
7 #define MODEL_WATERTOWATERCOMPONENT_IMPL_HPP
8
9 #include "WaterToWaterComponent.hpp"
10
11 #include "HVACComponent_Impl.hpp"
12
13 namespace openstudio {
14
15 namespace model {
16
17 class AirLoopHVAC;
18
19 namespace detail {
20
21 class MODEL_API WaterToWaterComponent_Impl : public HVACComponent_Impl
22 {
23 public:
24 WaterToWaterComponent_Impl(IddObjectType type, Model_Impl* model);
25
26 WaterToWaterComponent_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle);
27
28 WaterToWaterComponent_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle);
29
30 WaterToWaterComponent_Impl(const WaterToWaterComponent_Impl& other, Model_Impl* model, bool keepHandles);
31
32 373 virtual ~WaterToWaterComponent_Impl() override = default;
33
34 virtual unsigned supplyInletPort() const = 0;
35
36 virtual unsigned supplyOutletPort() const = 0;
37
38 virtual unsigned demandInletPort() const = 0;
39
40 virtual unsigned demandOutletPort() const = 0;
41
42 virtual boost::optional<ModelObject> supplyInletModelObject() const;
43
44 virtual boost::optional<ModelObject> supplyOutletModelObject() const;
45
46 virtual boost::optional<ModelObject> demandInletModelObject() const;
47
48 virtual boost::optional<ModelObject> demandOutletModelObject() const;
49
50 virtual std::vector<HVACComponent> edges(const boost::optional<HVACComponent>& prev) override;
51
52 virtual boost::optional<ParentObject> parent() const override;
53
54 virtual std::vector<ModelObject> children() const override;
55
56 virtual bool addToNode(Node& node) override;
57
58 virtual std::vector<openstudio::IdfObject> remove() override;
59
60 virtual ModelObject clone(Model model) const override;
61
62 void disconnect() override;
63
64 /*
65 * This method checks for presence of the WaterToWaterComponent on the supply side of plantLoops
66 * and checks that it isn't the tertiary plant loop
67 */
68 virtual boost::optional<PlantLoop> plantLoop() const override;
69
70 /*
71 * This method checks for presence of the WaterToWaterComponent on the demand side of plantLoops
72 * and checks that it isn't the tertiary plant loop
73 */
74 virtual boost::optional<PlantLoop> secondaryPlantLoop() const;
75
76 bool removeFromPlantLoop();
77
78 virtual bool removeFromSecondaryPlantLoop();
79
80 virtual unsigned tertiaryInletPort() const;
81
82 virtual unsigned tertiaryOutletPort() const;
83
84 /*
85 * This method checks for presence of the WaterToWaterComponent on either the supply or demand side of plantLoops
86 * and does an extra check for actual node: the tertiaryOutletModelObject has to be on the plant loop too
87 */
88 virtual boost::optional<PlantLoop> tertiaryPlantLoop() const;
89
90 virtual bool removeFromTertiaryPlantLoop();
91
92 virtual bool addToTertiaryNode(Node& node);
93
94 boost::optional<ModelObject> tertiaryInletModelObject() const;
95
96 boost::optional<ModelObject> tertiaryOutletModelObject() const;
97
98 protected:
99 friend class Model_Impl;
100
101 mutable boost::optional<PlantLoop> m_secondaryPlantLoop;
102 mutable boost::optional<PlantLoop> m_tertiaryPlantLoop;
103
104 private:
105 REGISTER_LOGGER("openstudio.model.WaterToWaterComponent");
106 };
107
108 } // namespace detail
109
110 } // namespace model
111
112 } // namespace openstudio
113
114 #endif
115