![]() |
Iterator for as_hashmap.
To use the iterator, you can either initialize a stack allocated variable, use as_hashmap_iterator_init():
Or you can create a new heap allocated variable using as_hashmap_iterator_new():
To iterate, use as_hashmap_iterator_has_next() and as_hashmap_iterator_next():
When you are finished using the iterator, then you should release the iterator and associated resources:
The as_hashmap_iterator is a subtype of as_iterator. This allows you to alternatively use as_iterator functions, by typecasting as_hashmap_iterator to as_iterator.
Each of the as_iterator functions proxy to the as_hashmap_iterator functions. So, calling as_iterator_destroy() is equivalent to calling as_hashmap_iterator_destroy().
Definition at line 90 of file as_hashmap_iterator.h.
#include "as_hashmap_iterator.h"
Inheritance diagram for as_hashmap_iterator:
Collaboration diagram for as_hashmap_iterator:Data Fields | |
| as_iterator | _ |
| void * | curr |
| void * | htable |
| void * | next |
| uint32_t | pos |
| uint32_t | size |
Data Fields inherited from as_iterator | |
| void * | data |
| struct as_iterator_hooks_s * | hooks |
Related Functions | |
(Note that these are not member functions.) | |
| void | as_hashmap_iterator_destroy (as_hashmap_iterator *iterator) |
| bool | as_hashmap_iterator_has_next (const as_hashmap_iterator *iterator) |
| as_hashmap_iterator * | as_hashmap_iterator_init (as_hashmap_iterator *iterator, const as_hashmap *map) |
| as_hashmap_iterator * | as_hashmap_iterator_new (const as_hashmap *map) |
| const as_val * | as_hashmap_iterator_next (as_hashmap_iterator *iterator) |
|
related |
Destroy the iterator and releases resources used by the iterator.
| iterator | The iterator to release |
|
related |
Tests if there are more values available in the iterator.
| iterator | The iterator to be tested. |
|
related |
Initializes a stack allocated as_iterator for the given as_hashmap.
| iterator | The iterator to initialize. |
| map | The map to iterate. |
|
related |
Creates a heap allocated as_iterator for the given as_hashmap.
| map | The map to iterate. |
|
related |
Attempts to get the next value from the iterator. This will return the next value, and iterate past the value.
| iterator | The iterator to get the next value from. |
| as_iterator as_hashmap_iterator::_ |
Definition at line 92 of file as_hashmap_iterator.h.
| void* as_hashmap_iterator::curr |
Current entry
Definition at line 102 of file as_hashmap_iterator.h.
| void* as_hashmap_iterator::htable |
The hashmap
Definition at line 97 of file as_hashmap_iterator.h.
| void* as_hashmap_iterator::next |
Next entry
Definition at line 107 of file as_hashmap_iterator.h.
| uint32_t as_hashmap_iterator::pos |
Position
Definition at line 112 of file as_hashmap_iterator.h.
| uint32_t as_hashmap_iterator::size |
Number of entries
Definition at line 117 of file as_hashmap_iterator.h.