300 */ |
291 */ |
301 cx_attr_nodiscard |
292 cx_attr_nodiscard |
302 CX_EXPORT CxMapIterator cxMapIterator(const CxMap *map); |
293 CX_EXPORT CxMapIterator cxMapIterator(const CxMap *map); |
303 |
294 |
304 /** |
295 /** |
305 * Creates a mutating iterator over the values of a map. |
|
306 * |
|
307 * When the map is storing pointers, those pointers are returned. |
|
308 * Otherwise, the iterator iterates over pointers to the memory within the map where the |
|
309 * respective elements are stored. |
|
310 * |
|
311 * @note An iterator iterates over all elements successively. Therefore, the order |
|
312 * highly depends on the map implementation and may change arbitrarily when the contents change. |
|
313 * |
|
314 * @param map the map to create the iterator for (can be @c NULL) |
|
315 * @return an iterator for the currently stored values |
|
316 */ |
|
317 cx_attr_nodiscard |
|
318 CX_EXPORT CxMapIterator cxMapMutIteratorValues(CxMap *map); |
|
319 |
|
320 /** |
|
321 * Creates a mutating iterator over the keys of a map. |
|
322 * |
|
323 * The elements of the iterator are keys of type CxHashKey, and the pointer returned |
|
324 * during iterator shall be treated as @c const @c CxHashKey* . |
|
325 * |
|
326 * @note An iterator iterates over all elements successively. Therefore, the order |
|
327 * highly depends on the map implementation and may change arbitrarily when the contents change. |
|
328 * |
|
329 * @param map the map to create the iterator for (can be @c NULL) |
|
330 * @return an iterator for the currently stored keys |
|
331 */ |
|
332 cx_attr_nodiscard |
|
333 CX_EXPORT CxMapIterator cxMapMutIteratorKeys(CxMap *map); |
|
334 |
|
335 /** |
|
336 * Creates a mutating iterator for a map. |
|
337 * |
|
338 * The elements of the iterator are key/value pairs of type CxMapEntry, and the pointer returned |
|
339 * during iterator shall be treated as @c const @c CxMapEntry* . |
|
340 * |
|
341 * @note An iterator iterates over all elements successively. Therefore, the order |
|
342 * highly depends on the map implementation and may change arbitrarily when the contents change. |
|
343 * |
|
344 * @param map the map to create the iterator for (can be @c NULL) |
|
345 * @return an iterator for the currently stored entries |
|
346 * @see cxMapMutIteratorKeys() |
|
347 * @see cxMapMutIteratorValues() |
|
348 */ |
|
349 cx_attr_nodiscard |
|
350 CX_EXPORT CxMapIterator cxMapMutIterator(CxMap *map); |
|
351 |
|
352 /** |
|
353 * Puts a key/value-pair into the map. |
296 * Puts a key/value-pair into the map. |
354 * |
297 * |
355 * A possible existing value will be overwritten. |
298 * A possible existing value will be overwritten. |
356 * If destructor functions are specified, they are called for |
299 * If destructor functions are specified, they are called for |
357 * the overwritten element. |
300 * the overwritten element. |