Closed jgraley closed 3 years ago
Regarding the new SubCollectionRange
class:
SubSequenceRange
to its base SubContainerRange
. This is not strange because all that stuff is orderedness-agnostic as it turns out.ContainerInterface::iterator
(the one that holds refs to the real iterators so it can be concrete and yet generic) implements iterator_interface
.SubContainerRangeWithExclusions
that uses a new iterator derived from ContainerInterface::iterator
but which holds a set of exclude iterators (via shared_ptr) and skips them. Hopefully only need to replace constructor and modifiers. SubCollectionRange
trivially derives from SubContainerRangeWithExclusions
. Exclusion set is a set of iterators.SubContainerRangeWithExclusions could support other values for begin/end for example to avoid the need for exclusions for things at back or front - but I don't propose to use this. We do need (at least one of) them if we're going to drop the container pointer from Range, though.
SubCollection
should now fall out of use: delete it - see #231
Keeping around for replace, but removed elts
for #231
Following on from #165. As seen in 8110b6cfe8648c4420237a6d3376c4b25bbea724 under
CHECK_ITERATOR_IN_CONTAINER
inStandardAgent::DecidedQueryCollection()
the iteratorxit
does not reference anything inxremaining
and I will call that detached (it probably references something inx_decision
orold_decision
).This could be remedied by:xremaining
under shared_ptr and swap around the copies until we're copying just before the erase (i.e. copy-on-write behaviour, where erase() is the write)Clone()
operation, and give it the ability to carry iterators forward, i.e. reattach to the copyend()-1
afterpush_back(value)
find(value)
afterinsert(value)
due uniquenessHowever, I don't want to do any of that. Wider concerns seem to suggest it's time to do Collection decisions differently:
DecidedQuery::Range
) are to include a set of exclusions. When conjecture increments, it will increment past these. No, do it in a new SubCollectionRange which uses new iterators that do the jumping - this is needed to avoid touching the replace codeStandardAgent::DecidedQueryCollection()
to fill these in as non-star patterns are matched off. And the NLQ!DecidedQuery::Range
is not needed and may be removed. To collection? if so yesNote that while it feels bad to put this set into decisions, the size of the set depends only on pattern: it's always <= the number of non-star children in the collection in the pattern. Also, this strategy is the one that will eventually be used by the CSP for collection multiplicities.