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


6.5.3 Operations on Iterators

In this section operations on map iterators are described.

Function: int qsmm_map_iter_is_end (qsmm_map_t mm, qsmm_iter_t iter)

This function returns a positive value if iterator iter is a forward (normal) iterator that refers to a place just after the last key-value pair in mapping object mm or if iterator iter is a reverse iterator that refers to a place just before the first key-value pair in mapping object mm, 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 refer to 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 a location of the first key-value pair in mapping object mm. After function completion, iterator result refers to that key-value pair. If the mapping object does not contain key-value pairs, then iterator result will refer to a place, commonly designated as a place just after the last key-value pair in the mapping object. The type of iterator result must agree with the type of mapping object mm. 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 iterator result to refer to a place just after the last key-value pair in mapping object mm. The type of iterator result must agree with the type of mapping object mm. 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 makes iterator result to be a reverse iterator that refers to the last key-value pair (in ascending order of keys) in mapping object mm. If the mapping object does not contain key-value pairs, then iterator result will refer to a place, commonly designated as a place just before the first key-value pair in the mapping object. The type of iterator result must agree with the type of mapping object mm. 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 makes iterator result to be a reverse iterator that refers to a place just before the first key-value pair in mapping object mm. The type of iterator result must agree with the type of mapping object mm. 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 iterator iter to refer to the next key-value pair in a mapping object. If iterator iter is a forward (normal) iterator, then it will refer to the next key-value pair in ascending order of keys. If iterator iter is a reverse iterator, then it will refer to the next key-value pair in descending order of keys (i.e. to the previous key-value pair in ascending order of keys).

Function: void qsmm_map_iter_prev (qsmm_iter_t iter)

This function makes iterator iter to refer to the previous key-value pair in a mapping object. If iterator iter is a forward (normal) iterator, then it will refer to the previous key-value pair in ascending order of keys (i.e. to the next key-value pair in descending order of keys). If iterator iter is a reverse iterator, then it will refer to the previous key-value pair in descending order of keys (i.e. to 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 iterator dst to refer to the same place as iterator src. An indication whether an iterator is forward (normal) or reverse one is also copied from src to dst. Iterators src and dst must be both created using either the function qsmm_map_iter_create or the function qsmm_map_multi_iter_create.

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

This function sets to valp the value part of a key-value pair addressed by iterator iter. An old value is discarded. If a value stored in the key-value pair object is an untyped pointer, then this function will set the value equal to valp. If the memory block of the key-value pair object contains the memory block of value, then this function will replace the contents of the latter memory block with the contents of a memory block addressed by valp.

Function: void * qsmm_map_iter_key (qsmm_iter_t iter)

This function returns the key component of a key-value pair addressed by iterator iter. If a key stored in the key-value pair object is an untyped pointer, then that pointer will be returned. If the memory block of the key-value pair object contains the memory block of key, then a pointer to the latter memory block will be returned.

Function: void * qsmm_map_iter_val (qsmm_iter_t iter)

This function returns the value component of a key-value pair addressed by iterator iter. If a value stored in the key-value pair object is an untyped pointer, then that pointer will be returned. If the memory block of the key-value pair object contains the memory block of value, then a pointer to the latter memory block will be returned.


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