HashTableIteratorAdvance
int HashTableIteratorAdvance (HashTableType table, HashTableIterator iterator);
Purpose
Advances a hash table iterator to the next key-value pair. If HashTableIteratorAdvance reaches the end of the table, the function returns HASH_TABLE_END.
An iterator traverses all the key-value pairs stored in the hash table. The iterator is like a pointer with two primary operations: referencing a given key-value pair in the hash table and modifying itself to point to the next key-value pair. You can create an iterator with HashTableIteratorCreate.
If you add or remove a key-value pair or resize the table, all iterators on the table are invalidated. If you use an invalidated iterator, HashTableIteratorAdvance returns an error.
Parameters
Input | ||
Name | Type | Description |
table | HashTableType | Hash table through which to iterate. |
iterator | HashTableIterator |
The iterator to advance. |
Return Value
Name | Type | Description |
status | int |
Returns a value indicating whether the function was successful.
A negative number means an error occurred. If the iterator reaches the end of the table, the function returns HASH_TABLE_END. For a detailed error message, pass the returned value to GetGeneralErrorString. |
Additional Information
Library: Programmer's Toolbox
Include file: toolbox\toolbox.h
LabWindows/CVI compatibility: LabWindows/CVI 8.5 and later
Example
Refer to toolbox\hashtable.cws for an example of using the HashTableIteratorAdvance function.