Lumiera  0.pre.03
»edit your freedom«
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 completeDiffApplication ()
 
void initDiffApplication ()
 
- Public Member Functions inherited from ListDiffInterpreter< E >
virtual ~ListDiffInterpreter ()
 this is an interface
 

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_
 
Vec & seq_
 
+ 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: