src/model/StraightComponent.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_STRAIGHTCOMPONENT_HPP | ||
| 7 | #define MODEL_STRAIGHTCOMPONENT_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 | class AirflowNetworkEquivalentDuct; | ||
| 18 | |||
| 19 | namespace detail { | ||
| 20 | class StraightComponent_Impl; | ||
| 21 | } | ||
| 22 | |||
| 23 | /** StraightComponent is the base class for HVACComponent objects which have precisely one inlet port and one outlet port. | ||
| 24 | * | ||
| 25 | * A StraighComponent may appear on either an AirLoopHVAC or a PlantLoop. | ||
| 26 | */ | ||
| 27 | class MODEL_API StraightComponent : public HVACComponent | ||
| 28 | { | ||
| 29 | |||
| 30 | public: | ||
| 31 | StraightComponent(IddObjectType type, const Model& model); | ||
| 32 | |||
| 33 | 418480 | virtual ~StraightComponent() override = default; | |
| 34 | // Default the copy and move operators because the virtual dtor is explicit | ||
| 35 | 96566 | StraightComponent(const StraightComponent& other) = default; | |
| 36 | 154443 | StraightComponent(StraightComponent&& other) = default; | |
| 37 | ✗ | StraightComponent& operator=(const StraightComponent&) = default; | |
| 38 | 1338 | StraightComponent& operator=(StraightComponent&&) = default; | |
| 39 | |||
| 40 | bool removeFromLoop(); | ||
| 41 | |||
| 42 | /** Returns the inlet port. **/ | ||
| 43 | unsigned inletPort() const; | ||
| 44 | |||
| 45 | /** Returns the outlet port. **/ | ||
| 46 | unsigned outletPort() const; | ||
| 47 | |||
| 48 | /** Returns the optional ModelObject connected to the inlet port. **/ | ||
| 49 | boost::optional<ModelObject> inletModelObject() const; | ||
| 50 | |||
| 51 | /** Returns the optional ModelObject connected to the outlet port. **/ | ||
| 52 | boost::optional<ModelObject> outletModelObject() const; | ||
| 53 | |||
| 54 | /** Returns the optional AirLoopHVAC object that this AirToAirComponent is attached to. | ||
| 55 | * | ||
| 56 | * Reimplemented from HVACComponent. | ||
| 57 | */ | ||
| 58 | boost::optional<AirLoopHVAC> airLoopHVAC() const; // cppcheck-suppress [duplInheritedMember] for documentation purposes | ||
| 59 | |||
| 60 | protected: | ||
| 61 | friend class Model; | ||
| 62 | |||
| 63 | friend class openstudio::IdfObject; | ||
| 64 | |||
| 65 | /// @cond | ||
| 66 | |||
| 67 | using ImplType = detail::StraightComponent_Impl; | ||
| 68 | |||
| 69 | explicit StraightComponent(std::shared_ptr<detail::StraightComponent_Impl> impl); | ||
| 70 | |||
| 71 | private: | ||
| 72 | REGISTER_LOGGER("openstudio.model.StraightComponent"); | ||
| 73 | |||
| 74 | /// @endcond | ||
| 75 | }; | ||
| 76 | |||
| 77 | using OptionalStraightComponent = boost::optional<StraightComponent>; | ||
| 78 | |||
| 79 | using StraightComponentVector = std::vector<StraightComponent>; | ||
| 80 | |||
| 81 | } // namespace model | ||
| 82 | } // namespace openstudio | ||
| 83 | |||
| 84 | #endif // MODEL_STRAIGHTCOMPONENT_HPP | ||
| 85 |