Closed dpazj closed 11 months ago
Some WIP comments:
@SteveOss ready for review
@SteveOss For array support we could allocate an iot_data_t and require a user to call a function like iot_data_iter_clear
once they have finished with the iter? Would be a bit inconsistent with other api usage, but would allow us to keep arrays.
@dpazj Even allocating an iot_data_t for an array iterator, doesn't work WRT to ownership when considering both lifetime of value and validity of scope, as essentially target collection type isn't holding iot_data. Also is pretty inefficient for iterating arrays of basic types. Not seeing a solution that works for array given existing iterator semantics.
recheck
@SteveOss CI seems to be stuck. Any ideas?
We discussed a generic array type iterator. Some of my current work would benefit from this so came up with an example implementation. Some feedback would be good before I go any further. Hopefully you can get the gist from this.
iter_get_value() for an iot_data_array_t would return an iot_data_t that user can read, however they would not be able to modify the underlying array, unless there is a way you can create a ref to an numerical type?