| 330 | } |
| 331 | |
| 332 | std::vector<ModelObject> AirLoopHVACOutdoorAirSystem_Impl::oaComponents(openstudio::IddObjectType type) const { |
| 333 | std::vector<ModelObject> modelObjects; |
| 334 | modelObjects.reserve(10); // Abritrary, but it wouldn't be common to have more objects than that |
| 335 | |
| 336 | OptionalModelObject modelObject = this->outdoorAirModelObject(); |
| 337 | |
| 338 | while (modelObject) { |
| 339 | if (auto comp_ = modelObject->optionalCast<StraightComponent>()) { |
| 340 | modelObject = comp_->inletModelObject(); |
| 341 | modelObjects.insert(modelObjects.begin(), std::move(*comp_)); |
| 342 | } else if (auto comp_ = modelObject->optionalCast<AirToAirComponent>()) { |
| 343 | modelObject = comp_->primaryAirInletModelObject(); |
| 344 | modelObjects.insert(modelObjects.begin(), std::move(*comp_)); |
| 345 | } else if (auto comp_ = modelObject->optionalCast<WaterToAirComponent>()) { |
| 346 | modelObject = comp_->airInletModelObject(); |
| 347 | modelObjects.insert(modelObjects.begin(), std::move(*comp_)); |
| 348 | } else if (auto comp_ = modelObject->optionalCast<ZoneHVACComponent>()) { |
| 349 | // For AirLoopHVACUnitarySystem and ZoneHVACTerminalUnitVariableRefrigerantFlow |
| 350 | modelObject = comp_->inletNode(); |
| 351 | modelObjects.insert(modelObjects.begin(), std::move(*comp_)); |
| 352 | } else { |
| 353 | LOG_AND_THROW("For " << briefDescription() << ", unexpected oaComponent found: " << modelObject->briefDescription()); |
| 354 | } |
| 355 | } |
| 356 | if (type != IddObjectType::Catchall) { |
| 357 | modelObjects.erase( |
| 358 | std::remove_if(modelObjects.begin(), modelObjects.end(), [&](const auto& mo) -> bool { return mo.iddObjectType() != type; }), |
| 359 | modelObjects.end()); |
| 360 | } |
| 361 | return modelObjects; |
| 362 | } |
| 363 | |
| 364 | std::vector<ModelObject> AirLoopHVACOutdoorAirSystem_Impl::reliefComponents(openstudio::IddObjectType type) const { |
| 365 | std::vector<ModelObject> modelObjects; |
no test coverage detected