Lumiera 0.pre.04
»edit your freedom«
Loading...
Searching...
No Matches
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 159 of file list-diff-detector.hpp.

Public Member Functions

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

Private Member Functions

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

Private Attributes

Idx old_
 
Idxnew_
 
size_t oldHead_ =0
 
size_t newHead_ =0
 
DiffStep currentStep_
 

Static Private Attributes

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

Constructor & Destructor Documentation

◆ DiffFrame()

template<class SEQ >
DiffFrame ( Idx current,
Idx &&  refPoint 
)
inline

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

Member Function Documentation

◆ checkPoint()

template<class SEQ >
bool checkPoint ( ) const
inline

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

References DiffLanguage< I, E >::NIL.

◆ yield()

template<class SEQ >
DiffStep & yield ( ) const
inline

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

◆ iterNext()

template<class SEQ >
void iterNext ( )
inline

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

◆ establishNextState()

template<class SEQ >
DiffStep establishNextState ( )
inlineprivate

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

References DiffLanguage< I, E >::NIL.

◆ hasOld()

template<class SEQ >
bool hasOld ( ) const
inlineprivate

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

References IndexTable< VAL >::size().

+ Here is the call graph for this function:

◆ hasNew()

template<class SEQ >
bool hasNew ( ) const
inlineprivate

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

References IndexTable< VAL >::size().

+ Here is the call graph for this function:

◆ canPick()

template<class SEQ >
bool canPick ( ) const
inlineprivate

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

◆ canDelete()

template<class SEQ >
bool canDelete ( ) const
inlineprivate

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

References IndexTable< VAL >::contains().

+ Here is the call graph for this function:

◆ canInsert()

template<class SEQ >
bool canInsert ( ) const
inlineprivate

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

References IndexTable< VAL >::contains().

+ Here is the call graph for this function:

◆ needFetch()

template<class SEQ >
bool needFetch ( ) const
inlineprivate

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

References IndexTable< VAL >::pos().

+ Here is the call graph for this function:

◆ obsoleted()

template<class SEQ >
bool obsoleted ( ) const
inlineprivate

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

References IndexTable< VAL >::pos().

+ Here is the call graph for this function:

◆ oldElm()

template<class SEQ >
Val const & oldElm ( ) const
inlineprivate

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

References IndexTable< VAL >::getElement().

+ Here is the call graph for this function:

◆ newElm()

template<class SEQ >
Val const & newElm ( ) const
inlineprivate

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

References IndexTable< VAL >::getElement().

+ Here is the call graph for this function:

◆ consumeOld()

template<class SEQ >
Val const & consumeOld ( )
inlineprivate

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

References IndexTable< VAL >::getElement().

+ Here is the call graph for this function:

◆ consumeNew()

template<class SEQ >
Val const & consumeNew ( )
inlineprivate

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

References IndexTable< VAL >::getElement().

+ Here is the call graph for this function:

Member Data Documentation

◆ old_

template<class SEQ >
Idx old_
private

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

◆ new_

template<class SEQ >
Idx* new_
private

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

◆ oldHead_

template<class SEQ >
size_t oldHead_ =0
private

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

◆ newHead_

template<class SEQ >
size_t newHead_ =0
private

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

◆ token

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

allocate static storage for the diff language token builder functions

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

◆ currentStep_

template<class SEQ >
DiffStep currentStep_
private

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

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

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