src/model/ZoneMRTCalculation.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_ZONEMRTCALCULATION_HPP | ||
| 7 | #define MODEL_ZONEMRTCALCULATION_HPP | ||
| 8 | |||
| 9 | #include "ModelAPI.hpp" | ||
| 10 | #include "ModelObject.hpp" | ||
| 11 | #include "People.hpp" | ||
| 12 | |||
| 13 | namespace openstudio { | ||
| 14 | namespace model { | ||
| 15 | |||
| 16 | class ThermalZone; | ||
| 17 | |||
| 18 | namespace detail { | ||
| 19 | |||
| 20 | class ZoneMRTCalculation_Impl; | ||
| 21 | class ThermalZone_Impl; | ||
| 22 | |||
| 23 | } // namespace detail | ||
| 24 | |||
| 25 | /** This class implements an MRT weighting factor. */ | ||
| 26 | class MODEL_API MRTWeightingFactor | ||
| 27 | { | ||
| 28 | public: | ||
| 29 | MRTWeightingFactor(const People& people, double mRTWeightingFactor); | ||
| 30 | |||
| 31 | People people() const; | ||
| 32 | double mRTWeightingFactor() const; | ||
| 33 | |||
| 34 | ✗ | bool operator==(const MRTWeightingFactor& other) const = default; | |
| 35 | bool operator!=(const MRTWeightingFactor& other) const; | ||
| 36 | |||
| 37 | private: | ||
| 38 | People m_people; | ||
| 39 | ✗ | double m_mRTWeightingFactor; | |
| 40 | − | REGISTER_LOGGER("openstudio.model.MRTWeightingFactor"); | |
| 41 | }; | ||
| 42 | |||
| 43 | /** \relates MRTWeightingFactor */ | ||
| 44 | MODEL_API std::ostream& operator<<(std::ostream& out, const openstudio::model::MRTWeightingFactor& mRTWeightingFactor); | ||
| 45 | |||
| 46 | /** ZoneMRTCalculation is a ModelObject that wraps the OpenStudio IDD object 'OS:ZoneMRTCalculation'. */ | ||
| 47 | class MODEL_API ZoneMRTCalculation : public ModelObject | ||
| 48 | { | ||
| 49 | public: | ||
| 50 | /** @name Constructors and Destructors */ | ||
| 51 | //@{ | ||
| 52 | |||
| 53 | 39 | virtual ~ZoneMRTCalculation() override = default; | |
| 54 | // Default the copy and move operators because the virtual dtor is explicit | ||
| 55 | 3 | ZoneMRTCalculation(const ZoneMRTCalculation& other) = default; | |
| 56 | 17 | ZoneMRTCalculation(ZoneMRTCalculation&& other) = default; | |
| 57 | ✗ | ZoneMRTCalculation& operator=(const ZoneMRTCalculation&) = default; | |
| 58 | ✗ | ZoneMRTCalculation& operator=(ZoneMRTCalculation&&) = default; | |
| 59 | |||
| 60 | //@} | ||
| 61 | |||
| 62 | static IddObjectType iddObjectType(); | ||
| 63 | |||
| 64 | /** @name Getters */ | ||
| 65 | //@{ | ||
| 66 | |||
| 67 | ThermalZone thermalZone() const; | ||
| 68 | |||
| 69 | //@} | ||
| 70 | /** @name Setters */ | ||
| 71 | //@{ | ||
| 72 | |||
| 73 | //@} | ||
| 74 | /** @name Other */ | ||
| 75 | //@{ | ||
| 76 | |||
| 77 | std::vector<MRTWeightingFactor> mRTWeightingFactors() const; | ||
| 78 | |||
| 79 | unsigned int numberofMRTWeightingFactors() const; | ||
| 80 | |||
| 81 | boost::optional<unsigned> mRTWeightingFactorIndex(const People& people) const; | ||
| 82 | |||
| 83 | boost::optional<MRTWeightingFactor> getMRTWeightingFactor(unsigned groupIndex) const; | ||
| 84 | |||
| 85 | bool addMRTWeightingFactor(const MRTWeightingFactor& mRTWeightingFactor); | ||
| 86 | |||
| 87 | bool addMRTWeightingFactor(const People& people, double mRTWeightingFactor); | ||
| 88 | |||
| 89 | bool addMRTWeightingFactors(const std::vector<MRTWeightingFactor>& mRTWeightingFactors); | ||
| 90 | |||
| 91 | void removeMRTWeightingFactor(int groupIndex); | ||
| 92 | |||
| 93 | void removeAllMRTWeightingFactors(); | ||
| 94 | |||
| 95 | //@} | ||
| 96 | protected: | ||
| 97 | /// @cond | ||
| 98 | using ImplType = detail::ZoneMRTCalculation_Impl; | ||
| 99 | |||
| 100 | /* | ||
| 101 | * This constructor shouldn't be used directly, ThermalZone::getZoneMRTCalculation should be preferred | ||
| 102 | * as it will either instantiate a new object or return the existing one. | ||
| 103 | * A ThermalZone should not have more than one ZoneMRTCalculation. If you try to instantiate a second one for a given | ||
| 104 | * ThermalZone this constructor will throw. | ||
| 105 | */ | ||
| 106 | explicit ZoneMRTCalculation(const ThermalZone& thermalZone); | ||
| 107 | |||
| 108 | explicit ZoneMRTCalculation(std::shared_ptr<detail::ZoneMRTCalculation_Impl> impl); | ||
| 109 | |||
| 110 | friend class detail::ZoneMRTCalculation_Impl; | ||
| 111 | friend class detail::ThermalZone_Impl; | ||
| 112 | friend class Model; | ||
| 113 | friend class IdfObject; | ||
| 114 | friend class openstudio::detail::IdfObject_Impl; | ||
| 115 | /// @endcond | ||
| 116 | private: | ||
| 117 | − | REGISTER_LOGGER("openstudio.model.ZoneMRTCalculation"); | |
| 118 | }; | ||
| 119 | |||
| 120 | /** \relates ZoneMRTCalculation*/ | ||
| 121 | using OptionalZoneMRTCalculation = boost::optional<ZoneMRTCalculation>; | ||
| 122 | |||
| 123 | /** \relates ZoneMRTCalculation*/ | ||
| 124 | using ZoneMRTCalculationVector = std::vector<ZoneMRTCalculation>; | ||
| 125 | |||
| 126 | } // namespace model | ||
| 127 | } // namespace openstudio | ||
| 128 | |||
| 129 | #endif // MODEL_ZONEMRTCALCULATION_HPP | ||
| 130 |