cvx
Loading...
Searching...
No Matches
dynamic_array_iter Struct Reference

ITERATOR. More...

#include <dynamic_array.h>

Data Fields

cvx_container super
 
size_t capacity
 
size_t pointer
 
size_t index
 
size_t count
 
TVal * buffer
 

Detailed Description

ITERATOR.

buffer_iterator.h

Status

[x] concept [x] v1 [ ] tests [ ] refine [ ] stabilize

The implementation of the buffer iterator can be tuned depending on what the underlying data structure needs.

This is the basic interface: for (struct iterator it = init_iter(&arr); !iter_at_end(&it); iter_next(&it)) { char *key = iter_key(&it); int value = iter_value(&it); ... }

User defined macro options

  • SPARSE(item): a function-like macro that receives and item and checks if this is just a "hole" or an actual item
  • CIRCULAR: if enabled, the pointer wraps around the buffer's capacity

Other macros

  • EMBEDDED: Used by other data structures to automatically implement an iterator. When this is enabled, it changes the input macros and prefixes them all with "IT_".

Field Documentation

◆ buffer

TVal* dynamic_array_iter::buffer

◆ capacity

size_t dynamic_array_iter::capacity

◆ count

size_t dynamic_array_iter::count

◆ index

size_t dynamic_array_iter::index

◆ pointer

size_t dynamic_array_iter::pointer

◆ super

cvx_container dynamic_array_iter::super

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