| 205 | } |
| 206 | |
| 207 | boost::optional<Building> Model_Impl::building() const { |
| 208 | if (m_cachedBuilding) { |
| 209 | return m_cachedBuilding; |
| 210 | } |
| 211 | |
| 212 | boost::optional<Building> result = this->model().getOptionalUniqueModelObject<Building>(); |
| 213 | if (result) { |
| 214 | m_cachedBuilding = result; |
| 215 | result->getImpl<Building_Impl>()->Building_Impl::onRemoveFromWorkspace.connect<Model_Impl, &Model_Impl::clearCachedBuilding>( |
| 216 | const_cast<openstudio::model::detail::Model_Impl*>(this)); |
| 217 | } |
| 218 | |
| 219 | return m_cachedBuilding; |
| 220 | } |
| 221 | |
| 222 | boost::optional<FoundationKivaSettings> Model_Impl::foundationKivaSettings() const { |
| 223 | if (m_cachedFoundationKivaSettings) { |