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().
| 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(). |
| 201 | void 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 | |
| 226 | bool SetNodeDataRequest::equals(const SetNodeData* item) const |
| 227 | { |
nothing calls this directly
no test coverage detected