| 39 | Schedule_Impl::Schedule_Impl(const Schedule_Impl& other, Model_Impl* model, bool keepHandles) : ScheduleBase_Impl(other, model, keepHandles) {} |
| 40 | |
| 41 | bool Schedule_Impl::candidateIsCompatibleWithCurrentUse(const ScheduleTypeLimits& candidate) const { |
| 42 | ModelObjectVector users = getObject<Schedule>().getModelObjectSources<ModelObject>(); |
| 43 | auto copyOfThis = getObject<Schedule>(); |
| 44 | for (const ModelObject& user : users) { |
| 45 | std::vector<ScheduleTypeKey> keys = user.getScheduleTypeKeys(copyOfThis); |
| 46 | // ETH@20120806 - Ideally would make the following OS_ASSERT, but is too |
| 47 | // strict for now. (Too easy for a user to trigger this first, before a unit |
| 48 | // test or app tester catches it.) |
| 49 | // OS_ASSERT(!keys.empty()); |
| 50 | for (const ScheduleTypeKey& key : keys) { |
| 51 | if (!isCompatible(key.className(), key.scheduleDisplayName(), candidate)) { |
| 52 | return false; |
| 53 | } |
| 54 | } |
| 55 | } |
| 56 | return true; |
| 57 | } |
| 58 | |
| 59 | bool Schedule_Impl::okToResetScheduleTypeLimits() const { |
| 60 | // ok to zero out if all users are schedules |
nothing calls this directly
no test coverage detected