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

Method createItem

kdevplatform/language/util/setrepository.cpp:201–224  ·  view source on GitHub ↗

Should create an item where the information of the requested item is permanently stored. The pointer @param item equals an allocated range with the size of itemSize().

Source from the content-addressed store, hash-verified

199//Should create an item where the information of the requested item is permanently stored. The pointer
200//@param item equals an allocated range with the size of itemSize().
201void SetNodeDataRequest::createItem(SetNodeData* item) const
202{
203 Q_ASSERT((data.rightNode() && data.leftNode()) || (!data.rightNode() && !data.leftNode()));
204
205 m_created = true;
206
207 *item = data;
208
209 Q_ASSERT((item->rightNode() && item->leftNode()) || (!item->rightNode() && !item->leftNode()));
210
211#ifdef DEBUG_SETREPOSITORY
212 //Make sure we split at the correct split position
213 if (item->hasSlaves()) {
214 uint split = splitPositionForRange(data.start, data.end);
215 const SetNodeData* left = repository.itemFromIndex(item->leftNode());
216 const SetNodeData* right = repository.itemFromIndex(item->rightNode());
217 Q_ASSERT(split >= left->end() && split <= right->start());
218 }
219#endif
220 if (!data.leftNode() && setRepository) {
221 for (uint a = item->start(); a < item->end(); ++a)
222 setRepository->itemAddedToSets(a);
223 }
224}
225
226bool SetNodeDataRequest::equals(const SetNodeData* item) const
227{

Callers

nothing calls this directly

Calls 5

splitPositionForRangeFunction · 0.85
itemAddedToSetsMethod · 0.80
itemFromIndexMethod · 0.45
endMethod · 0.45
startMethod · 0.45

Tested by

no test coverage detected