| 164 | } |
| 165 | |
| 166 | boost::optional<Schedule> SpaceType_Impl::getDefaultSchedule(const DefaultScheduleType& defaultScheduleType) const { |
| 167 | boost::optional<Schedule> result; |
| 168 | boost::optional<DefaultScheduleSet> defaultScheduleSet; |
| 169 | boost::optional<Building> building; |
| 170 | boost::optional<SpaceType> spaceType; |
| 171 | |
| 172 | // first check this object |
| 173 | defaultScheduleSet = this->defaultScheduleSet(); |
| 174 | if (defaultScheduleSet) { |
| 175 | result = defaultScheduleSet->getDefaultSchedule(defaultScheduleType); |
| 176 | if (result) { |
| 177 | return result; |
| 178 | } |
| 179 | } |
| 180 | |
| 181 | // then check building |
| 182 | building = this->model().building(); |
| 183 | if (building) { |
| 184 | defaultScheduleSet = building->defaultScheduleSet(); |
| 185 | if (defaultScheduleSet) { |
| 186 | result = defaultScheduleSet->getDefaultSchedule(defaultScheduleType); |
| 187 | if (result) { |
| 188 | return result; |
| 189 | } |
| 190 | } |
| 191 | |
| 192 | // then check building's space type |
| 193 | spaceType = building->spaceType(); |
| 194 | if (spaceType) { |
| 195 | defaultScheduleSet = spaceType->defaultScheduleSet(); |
| 196 | if (defaultScheduleSet) { |
| 197 | result = defaultScheduleSet->getDefaultSchedule(defaultScheduleType); |
| 198 | if (result) { |
| 199 | return result; |
| 200 | } |
| 201 | } |
| 202 | } |
| 203 | } |
| 204 | |
| 205 | return boost::none; |
| 206 | } |
| 207 | |
| 208 | bool SpaceType_Impl::setDefaultScheduleSet(const DefaultScheduleSet& defaultScheduleSet) { |
| 209 | return setPointer(OS_SpaceTypeFields::DefaultScheduleSetName, defaultScheduleSet.handle()); |
nothing calls this directly
no test coverage detected