MCPcopy Create free account
hub / github.com/KDE/kdevelop / indexForType

Method indexForType

kdevplatform/language/duchain/types/typerepository.cpp:113–135  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

111}
112
113uint 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
137AbstractType::Ptr TypeRepository::typeForIndex(uint index)
138{

Callers

nothing calls this directly

Calls 5

indexMethod · 0.45
equalsMethod · 0.45
toStringMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected