48#ifndef LIB_DIFF_LIST_DIFF_DETECTOR_H
49#define LIB_DIFF_LIST_DIFF_DETECTOR_H
81 using Val = SEQ::value_type;
113 if (snapshot !=
refIdx_.
end() && elm != *snapshot++)
175 , currentStep_(establishNextState())
184 return token.
NIL != currentStep_;
190 REQUIRE (checkPoint());
191 return unConst(
this)->currentStep_;
197 currentStep_ = this->establishNextState();
207 return token.pick (consumeNew());
210 return token.del (consumeOld());
212 return token.ins (consumeNew());
214 return token.find (consumeNew());
216 return token.skip (consumeOld());
223 bool canPick()
const {
return hasOld() && hasNew() && oldElm()==newElm(); }
226 bool needFetch()
const {
return hasNew() && oldHead_ < old_.
pos(newElm()); }
227 bool obsoleted()
const {
return hasOld() && newHead_ > new_->
pos(oldElm()); }
Another Lumiera Forward Iterator building block, based on incorporating a state type as »*State Core*...
A diff generation process is built on top of an "old" reference point and a "new" state of the underl...
static ListDiffLanguage< Val > token
allocate static storage for the diff language token builder functions
DiffFrame(Idx ¤t, Idx &&refPoint)
Val const & newElm() const
Val const & oldElm() const
DiffStep establishNextState()
Detect and describe changes in a monitored data sequence.
ListDiffLanguage< Val >::DiffStep DiffStep
Diff pullUpdate()
Diff generation core operation.
bool isChanged() const
does the current state of the underlying sequence differ from the state embodied into the last refere...
DiffDetector(SEQ const &refSeq)
lib::IterStateWrapper< DiffFrame > Diff
Diff is a iterator to yield a sequence of DiffStep elements.
bool contains(VAL const &elm) const
VAL const & getElement(size_t i) const
size_t pos(VAL const &elm) const
Any copy and copy construction prohibited.
Generic lookup table for a sequence of unique values.
Helper template(s) for creating Lumiera Forward Iterators.
A token language to represent changes in a list of elements.
Implementation namespace for support and library code.
OBJ * unConst(const OBJ *)
shortcut to save some typing when having to define const and non-const variants of member functions
Mix-Ins to allow or prohibit various degrees of copying and cloning.
static const DiffStep NIL
fixed "invalid" marker token