GCC Code Coverage Report


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

src/model/ConnectorSplitter.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_CONNECTORSPLITTER_HPP
7 #define MODEL_CONNECTORSPLITTER_HPP
8
9 #include "ModelAPI.hpp"
10 #include "Splitter.hpp"
11
12 namespace openstudio {
13
14 namespace model {
15
16 namespace detail {
17 class ConnectorSplitter_Impl;
18 } // namespace detail
19
20 /** ConnectorSplitter is an interface to the EnergyPlus IDD object named "OS:Connector:Splitter"
21 *
22 * The purpose of this class is to simplify the construction and manipulation
23 * of splitter objects in EnergyPlus. Methods are built around the
24 * acts of getting the inlet and outlet ports to the splitter. Branch indexes
25 * are used to refer to the many outlet ports of the mixer
26 */
27 class MODEL_API ConnectorSplitter : public Splitter
28 {
29 public:
30 /** Constructs a new Splitter object and places it inside the model. */
31 explicit ConnectorSplitter(const Model& model);
32
33 1069 virtual ~ConnectorSplitter() override = default;
34 // Default the copy and move operators because the virtual dtor is explicit
35 ✗ ConnectorSplitter(const ConnectorSplitter& other) = default;
36 5 ConnectorSplitter(ConnectorSplitter&& other) = default;
37 ✗ ConnectorSplitter& operator=(const ConnectorSplitter&) = default;
38 ✗ ConnectorSplitter& operator=(ConnectorSplitter&&) = default;
39
40 /** Returns the inlet port to the splitter. */
41 unsigned inletPort() const override;
42
43 /** Returns the outlet port for branchIndex. Branches consequtively
44 * indexed starting from 0.
45 */
46 unsigned outletPort(unsigned branchIndex) const override;
47
48 /** Returns the next available outlet port. This will be the first port
49 * with no connected objects */
50 unsigned nextOutletPort() const override;
51
52 virtual bool addToNode(Node& node);
53
54 virtual std::vector<openstudio::IdfObject> remove();
55
56 virtual ModelObject clone(Model model) const;
57
58 static IddObjectType iddObjectType();
59
60 protected:
61 using ImplType = detail::ConnectorSplitter_Impl;
62
63 friend class Model;
64
65 friend class openstudio::IdfObject;
66
67 explicit ConnectorSplitter(std::shared_ptr<detail::ConnectorSplitter_Impl> impl);
68
69 private:
70 REGISTER_LOGGER("openstudio.model.ConnectorSplitter");
71 };
72
73 /** \relates ConnectorSplitter */
74 using OptionalConnectorSplitter = boost::optional<ConnectorSplitter>;
75
76 } // namespace model
77 } // namespace openstudio
78
79 #endif // MODEL_CONNECTORSPLITTER_HPP
80