MCPcopy Create free account
hub / github.com/SmingHub/Sming / extractAt

Method extractAt

Sming/Core/Data/ObjectMap.h:291–299  ·  view source on GitHub ↗

* @brief Get the value at a given index and remove it from the map, without destroying it * @param index * @retval V* * @note The returned object must be freed by the caller when no longer required */

Source from the content-addressed store, hash-verified

289 * @note The returned object must be freed by the caller when no longer required
290 */
291 V* extractAt(unsigned index)
292 {
293 std::unique_ptr<V> value;
294 if(index < entries.count()) {
295 entries[index].value.swap(value);
296 entries.remove(index);
297 }
298 return value.release();
299 }
300
301 /**
302 * @brief Clear the map of all entries

Callers 1

multipartProducerMethod · 0.80

Calls 4

swapMethod · 0.80
countMethod · 0.45
removeMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected