src/model/AvailabilityManagerAssignmentList.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_AVAILABILITYMANAGERASSIGNMENTLIST_HPP | ||
| 7 | #define MODEL_AVAILABILITYMANAGERASSIGNMENTLIST_HPP | ||
| 8 | |||
| 9 | #include "ModelAPI.hpp" | ||
| 10 | #include "ModelObject.hpp" | ||
| 11 | |||
| 12 | namespace openstudio { | ||
| 13 | namespace model { | ||
| 14 | |||
| 15 | namespace detail { | ||
| 16 | |||
| 17 | class AvailabilityManagerAssignmentList_Impl; | ||
| 18 | class AirLoopHVAC_Impl; | ||
| 19 | class PlantLoop_Impl; | ||
| 20 | |||
| 21 | } // namespace detail | ||
| 22 | |||
| 23 | class AvailabilityManager; | ||
| 24 | class Loop; | ||
| 25 | class AirLoopHVAC; | ||
| 26 | class PlantLoop; | ||
| 27 | class ZoneHVACComponent; | ||
| 28 | |||
| 29 | /** AvailabilityManagerAssignmentList is a ModelObject that wraps the OpenStudio IDD object 'OS:AvailabilityManagerAssignmentList'. */ | ||
| 30 | class MODEL_API AvailabilityManagerAssignmentList : public ModelObject | ||
| 31 | { | ||
| 32 | public: | ||
| 33 | /** @name Constructors and Destructors */ | ||
| 34 | //@{ | ||
| 35 | |||
| 36 | /* | ||
| 37 | * Ctor needs a loop (AirLoopHVAC or PlantLoop). This shouldn't be used, the Loop Ctor will create one for you. | ||
| 38 | * At least until we implement AVMLists for ZoneHVAC equipment | ||
| 39 | */ | ||
| 40 | explicit AvailabilityManagerAssignmentList(const Loop& loop); | ||
| 41 | |||
| 42 | 4346 | virtual ~AvailabilityManagerAssignmentList() override = default; | |
| 43 | // Default the copy and move operators because the virtual dtor is explicit | ||
| 44 | 646 | AvailabilityManagerAssignmentList(const AvailabilityManagerAssignmentList& other) = default; | |
| 45 | 1331 | AvailabilityManagerAssignmentList(AvailabilityManagerAssignmentList&& other) = default; | |
| 46 | ✗ | AvailabilityManagerAssignmentList& operator=(const AvailabilityManagerAssignmentList&) = default; | |
| 47 | ✗ | AvailabilityManagerAssignmentList& operator=(AvailabilityManagerAssignmentList&&) = default; | |
| 48 | |||
| 49 | //@} | ||
| 50 | |||
| 51 | static IddObjectType iddObjectType(); | ||
| 52 | |||
| 53 | /** @name Getters */ | ||
| 54 | //@{ | ||
| 55 | |||
| 56 | /* | ||
| 57 | * Get the priority of a given AvailabilityManager | ||
| 58 | */ | ||
| 59 | unsigned availabilityManagerPriority(const AvailabilityManager& avm) const; | ||
| 60 | |||
| 61 | /* | ||
| 62 | * Return all AvailabilityManagers assigned to this list, in the priority order | ||
| 63 | */ | ||
| 64 | std::vector<AvailabilityManager> availabilityManagers() const; | ||
| 65 | |||
| 66 | /* | ||
| 67 | * Returns an optional Loop (base class for AirLoopHVAC & PlantLoop) to which this availabilityManagerAssignementList is assigned | ||
| 68 | */ | ||
| 69 | boost::optional<Loop> loop() const; | ||
| 70 | |||
| 71 | /* | ||
| 72 | * Returns an optional AirLoopHVAC to which this availabilityManagerAssignementList is assigned | ||
| 73 | */ | ||
| 74 | boost::optional<AirLoopHVAC> airLoopHVAC() const; | ||
| 75 | |||
| 76 | /* | ||
| 77 | * Returns an optional PlantLoop to which this availabilityManagerAssignementList is assigned | ||
| 78 | */ | ||
| 79 | boost::optional<PlantLoop> plantLoop() const; | ||
| 80 | |||
| 81 | /* | ||
| 82 | * Returns an optional HVAC Component to which this availabilityManagerAssignementList is assigned | ||
| 83 | * A number of other objects such as most of the ZoneHVAC stuff (ZoneHVAC:FourPipeFanCoil, ZoneHVAC:PackagedTerminalHeatPump, etc) | ||
| 84 | * as well as the AirLoopHVAC:OutdoorAirSystem can have an AvailabilityManagerAssignmentList, but it isn't implemented in OS IDD yet | ||
| 85 | */ | ||
| 86 | boost::optional<ZoneHVACComponent> containingZoneHVACComponent() const; | ||
| 87 | |||
| 88 | //@} | ||
| 89 | /** @name Setters */ | ||
| 90 | //@{ | ||
| 91 | |||
| 92 | /* | ||
| 93 | * Add a new AvailabilityManager at the end of the list (priority = last). | ||
| 94 | */ | ||
| 95 | bool addAvailabilityManager(const AvailabilityManager& avm); | ||
| 96 | |||
| 97 | /* | ||
| 98 | * Add a new AvailabilityManager to the list which a given priority (1 to x). | ||
| 99 | * Internally calls addAvailabilityManager then setAvailabilityManagerPriority, see remarks there | ||
| 100 | */ | ||
| 101 | bool addAvailabilityManager(const AvailabilityManager& avm, unsigned priority); | ||
| 102 | |||
| 103 | /* | ||
| 104 | * Set all availabilityManagers using a list of AvailabilityManagers | ||
| 105 | */ | ||
| 106 | bool setAvailabilityManagers(const std::vector<AvailabilityManager>& avms); | ||
| 107 | |||
| 108 | /* | ||
| 109 | * Removes all AvailabilityManagers in this list | ||
| 110 | */ | ||
| 111 | void resetAvailabilityManagers(); | ||
| 112 | |||
| 113 | /* | ||
| 114 | * Remove the given AvailabilityManager from this AvailabilityManagerAssignmentList | ||
| 115 | */ | ||
| 116 | bool removeAvailabilityManager(const AvailabilityManager& avm); | ||
| 117 | |||
| 118 | /* | ||
| 119 | * Remove the availabilityManager at the given priority | ||
| 120 | */ | ||
| 121 | bool removeAvailabilityManager(unsigned priority); | ||
| 122 | |||
| 123 | /* | ||
| 124 | * You can shuffle the priority of a given AvailabilityManager after having added it | ||
| 125 | * If priority is below 1, it's reset to 1. | ||
| 126 | * If priority is greater than the number of availability managers, will reset to last | ||
| 127 | */ | ||
| 128 | bool setAvailabilityManagerPriority(const AvailabilityManager& avm, unsigned priority); | ||
| 129 | |||
| 130 | //@} | ||
| 131 | /** @name Other */ | ||
| 132 | //@{ | ||
| 133 | |||
| 134 | //@} | ||
| 135 | protected: | ||
| 136 | /// @cond | ||
| 137 | using ImplType = detail::AvailabilityManagerAssignmentList_Impl; | ||
| 138 | |||
| 139 | explicit AvailabilityManagerAssignmentList(const Model& model); | ||
| 140 | explicit AvailabilityManagerAssignmentList(std::shared_ptr<detail::AvailabilityManagerAssignmentList_Impl> impl); | ||
| 141 | |||
| 142 | friend class detail::AvailabilityManagerAssignmentList_Impl; | ||
| 143 | friend class Model; | ||
| 144 | friend class IdfObject; | ||
| 145 | friend class detail::AirLoopHVAC_Impl; | ||
| 146 | friend class detail::PlantLoop_Impl; | ||
| 147 | friend class openstudio::detail::IdfObject_Impl; | ||
| 148 | /// @endcond | ||
| 149 | private: | ||
| 150 | REGISTER_LOGGER("openstudio.model.AvailabilityManagerAssignmentList"); | ||
| 151 | }; | ||
| 152 | |||
| 153 | /** \relates AvailabilityManagerAssignmentList*/ | ||
| 154 | using OptionalAvailabilityManagerAssignmentList = boost::optional<AvailabilityManagerAssignmentList>; | ||
| 155 | |||
| 156 | /** \relates AvailabilityManagerAssignmentList*/ | ||
| 157 | using AvailabilityManagerAssignmentListVector = std::vector<AvailabilityManagerAssignmentList>; | ||
| 158 | |||
| 159 | } // namespace model | ||
| 160 | } // namespace openstudio | ||
| 161 | |||
| 162 | #endif // MODEL_AVAILABILITYMANAGERASSIGNMENTLIST_HPP | ||
| 163 |