| 133 | } |
| 134 | |
| 135 | boost::optional<Schedule> BuildingStory_Impl::getDefaultSchedule(const DefaultScheduleType& defaultScheduleType) const { |
| 136 | boost::optional<Schedule> result; |
| 137 | boost::optional<DefaultScheduleSet> defaultScheduleSet; |
| 138 | boost::optional<Building> building; |
| 139 | boost::optional<SpaceType> spaceType; |
| 140 | |
| 141 | // first check this object |
| 142 | defaultScheduleSet = this->defaultScheduleSet(); |
| 143 | if (defaultScheduleSet) { |
| 144 | result = defaultScheduleSet->getDefaultSchedule(defaultScheduleType); |
| 145 | if (result) { |
| 146 | return result; |
| 147 | } |
| 148 | } |
| 149 | |
| 150 | // then check building |
| 151 | building = this->model().building(); |
| 152 | if (building) { |
| 153 | defaultScheduleSet = building->defaultScheduleSet(); |
| 154 | if (defaultScheduleSet) { |
| 155 | result = defaultScheduleSet->getDefaultSchedule(defaultScheduleType); |
| 156 | if (result) { |
| 157 | return result; |
| 158 | } |
| 159 | } |
| 160 | |
| 161 | // then check building's space type |
| 162 | spaceType = building->spaceType(); |
| 163 | if (spaceType) { |
| 164 | defaultScheduleSet = spaceType->defaultScheduleSet(); |
| 165 | if (defaultScheduleSet) { |
| 166 | result = defaultScheduleSet->getDefaultSchedule(defaultScheduleType); |
| 167 | if (result) { |
| 168 | return result; |
| 169 | } |
| 170 | } |
| 171 | } |
| 172 | } |
| 173 | |
| 174 | return boost::none; |
| 175 | } |
| 176 | |
| 177 | bool BuildingStory_Impl::setDefaultScheduleSet(const DefaultScheduleSet& defaultScheduleSet) { |
| 178 | return setPointer(OS_BuildingStoryFields::DefaultScheduleSetName, defaultScheduleSet.handle()); |
nothing calls this directly
no test coverage detected