| 81 | } |
| 82 | |
| 83 | ModelObject ComponentData_Impl::getComponentObject(unsigned objectIndex) const { |
| 84 | if (objectIndex >= numComponentObjects()) { |
| 85 | LOG_AND_THROW("objectIndex = " << objectIndex << " >= numComponentObjects() = " << numComponentObjects() << "."); |
| 86 | } |
| 87 | |
| 88 | IdfExtensibleGroup eg = getExtensibleGroup(objectIndex); |
| 89 | if (eg.empty()) { |
| 90 | LOG_AND_THROW("Cannot retrieve IdfExtensibleGroup at objectIndex = " << objectIndex); |
| 91 | } |
| 92 | |
| 93 | auto componentObjectData = eg.cast<ModelExtensibleGroup>(); |
| 94 | OptionalModelObject omo = componentObjectData.getModelObjectTarget<ModelObject>(OS_ComponentDataExtensibleFields::NameofObject); |
| 95 | if (!omo) { |
| 96 | LOG_AND_THROW("Cannot retrieve ModelObject at objectIndex = " << objectIndex); |
| 97 | } |
| 98 | |
| 99 | return *omo; |
| 100 | } |
| 101 | |
| 102 | UUID ComponentData_Impl::createVersionUUID() { |
| 103 | bool ok = setString(OS_ComponentDataFields::VersionUUID, toString(createUUID())); |
no test coverage detected