| 111 | } |
| 112 | |
| 113 | uint TypeRepository::indexForType(const AbstractType* input) |
| 114 | { |
| 115 | if (!input) |
| 116 | return 0; |
| 117 | |
| 118 | uint i = LockedItemRepository::write<AbstractType>( |
| 119 | [request = AbstractTypeDataRequest(*input)](TypeItemRepository& repo) { |
| 120 | return repo.index(request); |
| 121 | }); |
| 122 | #ifdef DEBUG_TYPE_REPOSITORY |
| 123 | AbstractType::Ptr t = typeForIndex(i); |
| 124 | if (!t->equals(input)) { |
| 125 | qCWarning(LANGUAGE) << "found type in repository does not equal source type:" << input->toString() << |
| 126 | t->toString(); |
| 127 | t->equals(input); |
| 128 | } |
| 129 | #ifdef ASSERT_ON_PROBLEM |
| 130 | Q_ASSERT(t->equals(input)); |
| 131 | Q_ASSERT(input->equals(t.data())); |
| 132 | #endif |
| 133 | #endif |
| 134 | return i; |
| 135 | } |
| 136 | |
| 137 | AbstractType::Ptr TypeRepository::typeForIndex(uint index) |
| 138 | { |
nothing calls this directly
no test coverage detected