cbase 1.50.0
C/C++ Static Template
Loading...
Searching...
No Matches
BaseMapIter Struct Reference

Iterator for walking all live entries in a map. More...

#include <base_map.h>

Collaboration diagram for BaseMapIter:

Public Attributes

BaseMapmap
usize bucket_idx
BaseMapNodenode

Detailed Description

Iterator for walking all live entries in a map.

Initialize with base_map_iter_begin(), advance with base_map_iter_next().

for (BaseMapNode *n = base_map_iter_next(&it); n; n = base_map_iter_next(&it)) {
printf("%.*s\n", STR8_FMT(n->key));
}
BaseMapIter base_map_iter_begin(BaseMap *map)
Initializes an iterator positioned before the first entry.
BaseMapNode * base_map_iter_next(BaseMapIter *it)
Advances the iterator and returns the next live node.
#define STR8_FMT(s)
Helper macro to use a String8 in a printf-style format string. Example:
Iterator for walking all live entries in a map.
Definition base_map.h:118
BaseMap * map
Definition base_map.h:119

Definition at line 118 of file base_map.h.

Member Data Documentation

◆ bucket_idx

usize BaseMapIter::bucket_idx

Current bucket index.

Definition at line 120 of file base_map.h.

◆ map

BaseMap* BaseMapIter::map

The map being iterated.

Definition at line 119 of file base_map.h.

◆ node

BaseMapNode* BaseMapIter::node

Current node within the bucket chain.

Definition at line 121 of file base_map.h.


The documentation for this struct was generated from the following file: