Previous: , Up: The Implementation of Functionality of STL map Template   [Contents][Index]


6.5.3 Operations on Iterators

Map iterators support the following operations.

Function: int qsmm_map_iter_is_end (qsmm_map_t mm, qsmm_iter_t iter)

This function returns a positive value if an iterator iter is a forward (normal) iterator addressing a location just after the last key-value pair in a mapping object mm, or if the iterator is a reverse iterator addressing a location just before the first key-value pair in the mapping object, or returns 0 otherwise. The function never returns negative values.

Function: int qsmm_map_iter_are_equal (qsmm_iter_t iter1, qsmm_iter_t iter2)

This function returns a positive value if iterators iter1 and iter2 address the same location in a mapping object, or returns 0 otherwise. The function never returns negative values.

Function: void qsmm_map_iter_begin (qsmm_map_t mm, qsmm_iter_t result)

This function retrieves the location of the first key-value pair in a mapping object mm. After function completion, an iterator result addresses that key-value pair. If the mapping object does not contain key-value pairs, the iterator addresses a location commonly designated as a location just after the last key-value pair in the mapping object. An iterator type must agree with a mapping object type. The function corresponds to the method begin of STL map and multimap templates.

Function: void qsmm_map_iter_end (qsmm_map_t mm, qsmm_iter_t result)

This function makes an iterator result address a location just after the last key-value pair in a mapping object mm. An iterator type must agree with a mapping object type. The function corresponds to the method end of STL map and multimap templates.

Function: void qsmm_map_iter_rbegin (qsmm_map_t mm, qsmm_iter_t result)

This function sets an iterator result to be a reverse iterator addressing the last key-value pair (in ascending order of keys) in a mapping object mm. If the mapping object does not contain key-value pairs, the iterator addresses a location commonly designated as a location just before the first key-value pair in the mapping object. An iterator type must agree with a mapping object type. The function corresponds to the method rbegin of STL map and multimap templates.

Function: void qsmm_map_iter_rend (qsmm_map_t mm, qsmm_iter_t result)

This function sets an iterator result to be a reverse iterator addressing a location just before the first key-value pair in a mapping object mm. An iterator type must agree with a mapping object type. The function corresponds to the method rend of STL map and multimap templates.

Function: void qsmm_map_iter_next (qsmm_iter_t iter)

This function makes an iterator iter address the next key-value pair in a mapping object. If the iterator is a forward (normal) iterator, it addresses the next key-value pair in ascending order of keys. If the iterator is a reverse iterator, it addresses the next key-value pair in descending order of keys (i.e. the previous key-value pair in ascending order of keys).

Function: void qsmm_map_iter_prev (qsmm_iter_t iter)

This function makes an iterator iter address the previous key-value pair in a mapping object. If the iterator is a forward (normal) iterator, it addresses the previous key-value pair in ascending order of keys (i.e. the next key-value pair in descending order of keys). If the iterator is a reverse iterator, it addresses the previous key-value pair in descending order of keys (i.e. the next key-value pair in ascending order of keys).

Function: void qsmm_map_iter_assign (qsmm_iter_t dst, qsmm_iter_t src)

This function makes an iterator dst address the same location as an iterator src. The function also copies from src to dst an indication whether an iterator is forward (normal) or reverse one. Either the function qsmm_map_iter_create or the function qsmm_map_multi_iter_create must have created both iterators.

Function: void qsmm_map_iter_set_val (qsmm_iter_t iter, void *valp)

This function sets to valp the value of a key-value pair addressed by an iterator iter and discards an old value. If values stored in key-value pair objects are untyped pointers, the function sets the untyped pointer equal to valp. If the memory blocks of key-value pair objects contain the memory blocks of values, the function copies a memory block addressed by valp to the key-value pair object.

Function: void * qsmm_map_iter_key (qsmm_iter_t iter)

This function returns the key of a key-value pair addressed by an iterator iter. If keys stored in key-value pair objects are untyped pointers, the function returns such untyped pointer. If the memory blocks of key-value pair objects contain the memory blocks of keys, the function returns a pointer to the memory block of a key.

Function: void * qsmm_map_iter_val (qsmm_iter_t iter)

This function returns the value of a key-value pair addressed by an iterator iter. If values stored in key-value pair objects are untyped pointers, the function returns such untyped pointer. If the memory blocks of key-value pair objects contain the memory blocks of values, the function returns a pointer to the memory block of a value.


Previous: , Up: The Implementation of Functionality of STL map Template   [Contents][Index]