![]() |
das2C
das core C utilities (v3)
|
A non-degenerate iterator. More...
#include <das3/iterator.h>

Public Member Functions | |
| DAS_API void | DasDsUniqIter_init (DasDsUniqIter *pThis, const DasDs *pDs, const DasVar *pVar) |
| Initialize a non-degenerate iterator for a variable. | |
| DAS_API bool | DasDsUniqIter_next (DasDsUniqIter *pThis) |
| Increment the iterator's index by one position, rolling as needed at data boundaries. | |
Data Fields | |
| bool | done |
| If true the current value in the index is valid, false otherwise. | |
| ptrdiff_t | index [VARIDX_MAX] |
| A dataset bulk iteration index suitable for use in DasVar functions like ::DasVar_get. | |
| bool | lock [VARIDX_MAX] |
| A list of index values that will be auto assigned to zero. | |
| int | first |
| Shortcut iteration by saving off the indexes that matter. | |
A non-degenerate iterator.
| DAS_API void DasDsUniqIter_init | ( | DasDsUniqIter * | pThis, |
| const DasDs * | pDs, | ||
| const DasVar * | pVar | ||
| ) |
Initialize a non-degenerate iterator for a variable.
This iterator type runs over all indexes in a dataset except for those that are not used by the given variable. It works for ragged and cubic datasets. This is a convenient way to extract unique values for a variable.
For usage see the example in ::das_iterator
| pThis | A pointer to an iterator, will be initialize to index 0 |
| pDs | A pointer to a dataset. If the dataset changes while the iterator is in use invalid memory access could occur |
| DAS_API bool DasDsUniqIter_next | ( | DasDsUniqIter * | pThis | ) |
Increment the iterator's index by one position, rolling as needed at data boundaries.
For efficiency this function does not re-check array bounds on each call a slower but safer version of this function could be created if needed.
For usage see the example in ::das_iterator
| pThis | A pointer to an iterator. The index member of the iterator will be incremented. |