Array_view should return Ref when indexed
I was struggling over a week with indexing an Array_view
, but I think I have found missing puzzle.
Basically an Array_view
holds 2 information:
- Size with all dimensions of the view.
- List of chunk datatypes (one chunk datatype for each Ref (with array datatype) that is part of the
Array_view
).
Right now index method returns pair with moved pointer and new datatype.
In case of indexing Array_view
we want to return new Ref (we should reuse Referenced_buffer
with the same pointer but with changed list of chunks). So ideally the indexing should not move the pointer itself, but change the size of Array_view
and chunk datatypes in the list in that way, when we want the Refs from the Array_view
with chunk datatypes then we get correctly moved pointers from them.
This is fundamental change of relation between Datatype
and Ref
. Unfortunately I don't have time to design it and implement. What I am leaving is the Chunk_datatype
that is already tested and Array_view
that is partly implemented and partly tested on branch view_datatype.