Lumiera  0.pre.03
»edit your freedom«
list-diff.hpp
Go to the documentation of this file.
1 /*
2  LIST-DIFF.hpp - language to describe differences between list like sequences
3 
4  Copyright (C) Lumiera.org
5  2014, Hermann Vosseler <Ichthyostega@web.de>
6 
7  This program is free software; you can redistribute it and/or
8  modify it under the terms of the GNU General Public License as
9  published by the Free Software Foundation; either version 2 of
10  the License, or (at your option) any later version.
11 
12  This program is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  GNU General Public License for more details.
16 
17  You should have received a copy of the GNU General Public License
18  along with this program; if not, write to the Free Software
19  Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
20 
21 */
22 
23 
38 #ifndef LIB_DIFF_LIST_DIFF_H
39 #define LIB_DIFF_LIST_DIFF_H
40 
41 
43 
44 
45 namespace lib {
46 namespace diff{
47 
48 
71  template<typename E>
73  {
74  public:
75  virtual ~ListDiffInterpreter() { }
76 
77  virtual void ins (E const& e) =0;
78  virtual void del (E const& e) =0;
79  virtual void pick(E const& e) =0;
80  virtual void find(E const& e) =0;
81  virtual void skip(E const& e) =0;
82  };
83 
84  template<typename E>
86  : DiffLanguage<ListDiffInterpreter<E>, E>
87  {
89 
90  DiffStep_CTOR(ins);
91  DiffStep_CTOR(del);
92  DiffStep_CTOR(pick);
93  DiffStep_CTOR(find);
94  DiffStep_CTOR(skip);
95  };
96 
97 
98 
99 
100 }} // namespace lib::diff
101 #endif /*LIB_DIFF_LIST_DIFF_H*/
Fundamental definitions for a representation of changes.
Interpreter interface to define the operations ("verbs"), which describe differences or changes in a ...
Definition: list-diff.hpp:72
Implementation namespace for support and library code.
virtual ~ListDiffInterpreter()
this is an interface
Definition: list-diff.hpp:75
Definition frame for a language to describe differences in data structures.
#define DiffStep_CTOR(_ID_)
shortcut to define tokens of the diff language.