src/model/AvailabilityManager.cpp
| 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 | #include "AvailabilityManager.hpp" | ||
| 7 | #include "AvailabilityManager_Impl.hpp" | ||
| 8 | #include "AvailabilityManagerAssignmentList.hpp" | ||
| 9 | #include "AvailabilityManagerAssignmentList_Impl.hpp" | ||
| 10 | #include "AirLoopHVAC.hpp" | ||
| 11 | #include "AirLoopHVAC_Impl.hpp" | ||
| 12 | #include "Loop.hpp" | ||
| 13 | #include "Loop_Impl.hpp" | ||
| 14 | #include "Model.hpp" | ||
| 15 | #include "Model_Impl.hpp" | ||
| 16 | #include "../utilities/core/Assert.hpp" | ||
| 17 | |||
| 18 | namespace openstudio { | ||
| 19 | |||
| 20 | namespace model { | ||
| 21 | |||
| 22 | namespace detail { | ||
| 23 | |||
| 24 | ✗ | AvailabilityManager_Impl::AvailabilityManager_Impl(IddObjectType type, Model_Impl* model) : ModelObject_Impl(type, model) {} | |
| 25 | |||
| 26 | 85 | AvailabilityManager_Impl::AvailabilityManager_Impl(const IdfObject& idfObject, Model_Impl* model, bool keepHandle) | |
| 27 | 85 | : ModelObject_Impl(idfObject, model, keepHandle) {} | |
| 28 | |||
| 29 | 4 | AvailabilityManager_Impl::AvailabilityManager_Impl(const openstudio::detail::WorkspaceObject_Impl& other, Model_Impl* model, bool keepHandle) | |
| 30 | 4 | : ModelObject_Impl(other, model, keepHandle) {} | |
| 31 | |||
| 32 | 87 | AvailabilityManager_Impl::AvailabilityManager_Impl(const AvailabilityManager_Impl& other, Model_Impl* model, bool keepHandles) | |
| 33 | 87 | : ModelObject_Impl(other, model, keepHandles) {} | |
| 34 | |||
| 35 | 30 | boost::optional<Loop> AvailabilityManager_Impl::loop() const { | |
| 36 |
1/1✓ Branch 1 taken 30 times.
|
30 | auto t_handle = handle(); |
| 37 |
4/4✓ Branch 1 taken 30 times.
✓ Branch 4 taken 30 times.
✓ Branch 12 taken 27 times.
✓ Branch 13 taken 5 times.
|
32 | for (const auto& avmList : model().getConcreteModelObjects<AvailabilityManagerAssignmentList>()) { |
| 38 |
3/3✓ Branch 1 taken 27 times.
✓ Branch 8 taken 27 times.
✓ Branch 9 taken 2 times.
|
29 | for (const auto& avm : avmList.availabilityManagers()) { |
| 39 |
4/4✓ Branch 1 taken 27 times.
✓ Branch 4 taken 27 times.
✓ Branch 6 taken 25 times.
✓ Branch 7 taken 2 times.
|
27 | if (avm.handle() == t_handle) { |
| 40 |
1/1✓ Branch 1 taken 25 times.
|
25 | return avmList.loop(); |
| 41 | } | ||
| 42 | 27 | } | |
| 43 | 30 | } | |
| 44 | 5 | return boost::none; | |
| 45 | } | ||
| 46 | |||
| 47 | } // namespace detail | ||
| 48 | |||
| 49 | 81 | AvailabilityManager::AvailabilityManager(IddObjectType type, const Model& model) : ModelObject(type, model) { | |
| 50 |
1/3✗ Branch 2 not taken.
✓ Branch 3 taken 81 times.
✗ Branch 5 not taken.
|
81 | OS_ASSERT(getImpl<detail::AvailabilityManager_Impl>()); |
| 51 | 81 | } | |
| 52 | |||
| 53 |
1/1✓ Branch 3 taken 601 times.
|
601 | AvailabilityManager::AvailabilityManager(std::shared_ptr<detail::AvailabilityManager_Impl> p) : ModelObject(std::move(p)) {} |
| 54 | |||
| 55 | 15 | boost::optional<Loop> AvailabilityManager::loop() const { | |
| 56 |
1/1✓ Branch 3 taken 15 times.
|
15 | return getImpl<detail::AvailabilityManager_Impl>()->loop(); |
| 57 | } | ||
| 58 | |||
| 59 | } // namespace model | ||
| 60 | |||
| 61 | } // namespace openstudio | ||
| 62 |