Lumiera  0.pre.03
»edityourfreedom«
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
DiffApplicationStrategy< vector< E, ARGS...> > Class Template Reference

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

Description

template<typename E, typename... ARGS>
class lib::diff::DiffApplicationStrategy< vector< E, ARGS...> >

concrete strategy to apply a list diff to a target sequence given as vector.

The implementation swaps aside the existing content of the target sequence and then consumes it step by step, while building up the altered content within the previously emptied target vector. Whenever possible, elements are moved directly to the target location.

Exceptions
lumiera::error::Statewhen diff application fails due to the target sequence being different than assumed by the given diff.
Warning
behaves only EX_SANE in case of diff application errors, i.e. only partially modified / rebuilt sequence might be in the target when diff application is aborted
See also
#ListDiffInterpreter explanation of the verbs

Definition at line 72 of file list-diff-application.hpp.

Public Member Functions

 DiffApplicationStrategy (vector< E > &targetVector)
 
void initDiffApplication ()
 
- Public Member Functions inherited from ListDiffInterpreter< E >
virtual ~ListDiffInterpreter ()
 this is an interface More...
 

Private Types

using Iter = typename Vec::iterator
 
using Vec = vector< E, ARGS...>
 

Private Member Functions

void __expect_found (E const &elm, Iter const &targetPos)
 
void __expect_further_elements (E const &elm)
 
void __expect_in_target (E const &elm, Literal oper)
 
void del (E const &elm) override
 
bool end_of_target ()
 
void find (E const &elm) override
 
void ins (E const &elm) override
 
void pick (E const &elm) override
 
void skip (E const &elm) override
 

Private Attributes

Vec orig_
 
Iter pos_
 
Vecseq_
 

Member Typedef Documentation

using Vec = vector<E,ARGS...>
private

Definition at line 75 of file list-diff-application.hpp.

using Iter = typename Vec::iterator
private

Definition at line 76 of file list-diff-application.hpp.

Constructor & Destructor Documentation

DiffApplicationStrategy ( vector< E > &  targetVector)
inlineexplicit

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

Member Function Documentation

bool end_of_target ( )
inlineprivate

Definition at line 83 of file list-diff-application.hpp.

void __expect_in_target ( E const &  elm,
Literal  oper 
)
inlineprivate

Definition at line 89 of file list-diff-application.hpp.

References LERR_.

void __expect_further_elements ( E const &  elm)
inlineprivate

Definition at line 103 of file list-diff-application.hpp.

References LERR_.

void __expect_found ( E const &  elm,
Iter const &  targetPos 
)
inlineprivate

Definition at line 112 of file list-diff-application.hpp.

References LERR_.

void ins ( E const &  elm)
inlineoverrideprivatevirtual

Implements ListDiffInterpreter< E >.

Definition at line 124 of file list-diff-application.hpp.

void del ( E const &  elm)
inlineoverrideprivatevirtual

Implements ListDiffInterpreter< E >.

Definition at line 130 of file list-diff-application.hpp.

void pick ( E const &  elm)
inlineoverrideprivatevirtual

Implements ListDiffInterpreter< E >.

Definition at line 137 of file list-diff-application.hpp.

void skip ( E const &  elm)
inlineoverrideprivatevirtual

Implements ListDiffInterpreter< E >.

Definition at line 145 of file list-diff-application.hpp.

void find ( E const &  elm)
inlineoverrideprivatevirtual

Implements ListDiffInterpreter< E >.

Definition at line 152 of file list-diff-application.hpp.

References proc::mobject::session::test::find().

+ Here is the call graph for this function:

void initDiffApplication ( )
inline

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

Member Data Documentation

Vec orig_
private

Definition at line 78 of file list-diff-application.hpp.

Vec& seq_
private

Definition at line 79 of file list-diff-application.hpp.

Iter pos_
private

Definition at line 80 of file list-diff-application.hpp.

+ Inheritance diagram for DiffApplicationStrategy< vector< E, ARGS...> >:
+ Collaboration diagram for DiffApplicationStrategy< vector< E, ARGS...> >:

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