Lumiera  0.pre.03
»edityourfreedom«
DiffDetector< SEQ >::DiffFrame Class Reference

#include "lib/diff/list-diff-detector.hpp"

Description

template<class SEQ>
class lib::diff::DiffDetector< SEQ >::DiffFrame

A diff generation process is built on top of an "old" reference point and a "new" state of the underlying sequence.

Within this reference frame, an demand-driven evaluation of the differences is handed out to the client as an iterator. While consuming this evaluation process, both the old and the new version of the sequence will be traversed once. In case of re-orderings, a nested forward lookup similar to insertion sort will look for matches in the old sequence, rendering the whole evaluation quadratic in worst-case.

Definition at line 168 of file list-diff-detector.hpp.

Public Member Functions

 DiffFrame (Idx &current, Idx &&refPoint)
 
bool checkPoint () const
 
void iterNext ()
 
DiffStepyield () const
 

Private Member Functions

bool canDelete () const
 
bool canInsert () const
 
bool canPick () const
 
Val const & consumeNew ()
 
Val const & consumeOld ()
 
DiffStep establishNextState ()
 
bool hasNew () const
 
bool hasOld () const
 
bool needFetch () const
 
Val const & newElm () const
 
bool obsoleted () const
 
Val const & oldElm () const
 

Private Attributes

DiffStep currentStep_
 
Idxnew_
 
size_t newHead_
 
Idx old_
 
size_t oldHead_
 

Static Private Attributes

static ListDiffLanguage< Valtoken
 allocate static storage for the diff language token builder functions More...
 

Constructor & Destructor Documentation

◆ DiffFrame()

DiffFrame ( Idx current,
Idx &&  refPoint 
)
inline

Definition at line 181 of file list-diff-detector.hpp.

Member Function Documentation

◆ checkPoint()

bool checkPoint ( ) const
inline

Definition at line 191 of file list-diff-detector.hpp.

References DiffLanguage< I, E >::NIL.

◆ yield()

DiffStep& yield ( ) const
inline

Definition at line 197 of file list-diff-detector.hpp.

References util::unConst().

+ Here is the call graph for this function:

◆ iterNext()

void iterNext ( )
inline

Definition at line 204 of file list-diff-detector.hpp.

◆ establishNextState()

DiffStep establishNextState ( )
inlineprivate

Definition at line 211 of file list-diff-detector.hpp.

References DiffLanguage< I, E >::NIL.

◆ hasOld()

bool hasOld ( ) const
inlineprivate

Definition at line 230 of file list-diff-detector.hpp.

References IndexTable< VAL >::size().

+ Here is the call graph for this function:

◆ hasNew()

bool hasNew ( ) const
inlineprivate

Definition at line 231 of file list-diff-detector.hpp.

References IndexTable< VAL >::size().

+ Here is the call graph for this function:

◆ canPick()

bool canPick ( ) const
inlineprivate

Definition at line 232 of file list-diff-detector.hpp.

◆ canDelete()

bool canDelete ( ) const
inlineprivate

Definition at line 233 of file list-diff-detector.hpp.

References IndexTable< VAL >::contains().

+ Here is the call graph for this function:

◆ canInsert()

bool canInsert ( ) const
inlineprivate

Definition at line 234 of file list-diff-detector.hpp.

References IndexTable< VAL >::contains().

+ Here is the call graph for this function:

◆ needFetch()

bool needFetch ( ) const
inlineprivate

Definition at line 235 of file list-diff-detector.hpp.

References IndexTable< VAL >::pos().

+ Here is the call graph for this function:

◆ obsoleted()

bool obsoleted ( ) const
inlineprivate

Definition at line 236 of file list-diff-detector.hpp.

References IndexTable< VAL >::pos().

+ Here is the call graph for this function:

◆ oldElm()

Val const& oldElm ( ) const
inlineprivate

Definition at line 238 of file list-diff-detector.hpp.

References IndexTable< VAL >::getElement().

+ Here is the call graph for this function:

◆ newElm()

Val const& newElm ( ) const
inlineprivate

Definition at line 239 of file list-diff-detector.hpp.

References IndexTable< VAL >::getElement().

+ Here is the call graph for this function:

◆ consumeOld()

Val const& consumeOld ( )
inlineprivate

Definition at line 240 of file list-diff-detector.hpp.

References IndexTable< VAL >::getElement().

+ Here is the call graph for this function:

◆ consumeNew()

Val const& consumeNew ( )
inlineprivate

Definition at line 241 of file list-diff-detector.hpp.

References IndexTable< VAL >::getElement().

+ Here is the call graph for this function:

Member Data Documentation

◆ old_

Idx old_
private

Definition at line 170 of file list-diff-detector.hpp.

◆ new_

Idx* new_
private

Definition at line 171 of file list-diff-detector.hpp.

◆ oldHead_

size_t oldHead_
private

Definition at line 172 of file list-diff-detector.hpp.

◆ newHead_

size_t newHead_
private

Definition at line 173 of file list-diff-detector.hpp.

◆ token

ListDiffLanguage< typename DiffDetector< SEQ >::Val > token
staticprivate

allocate static storage for the diff language token builder functions

Definition at line 175 of file list-diff-detector.hpp.

◆ currentStep_

DiffStep currentStep_
private

Definition at line 177 of file list-diff-detector.hpp.

+ Collaboration diagram for DiffDetector< SEQ >::DiffFrame:

The documentation for this class was generated from the following file: