stub the diff verb operations.

passes compilation again
This commit is contained in:
Fischlurch 2015-10-09 03:44:38 +02:00
parent 2704b38da6
commit 90f31df8c0
4 changed files with 99 additions and 5 deletions

View file

@ -118,6 +118,7 @@ namespace diff{
using std::string;
struct GenNode;
struct Ref;
/** Define actual data storage and access types used */
template<>
@ -253,9 +254,10 @@ namespace diff{
////////////////////////TICKET #963 Forwarding shadows copy operations -- generic solution??
GenNode(GenNode const&) =default;
GenNode(GenNode&&) =default;
GenNode(GenNode& o)
: GenNode((GenNode const&)o)
{ }
GenNode(GenNode& o) : GenNode((GenNode const&)o) { }
GenNode(Ref const& r) : GenNode((GenNode const&)r) { }
GenNode(Ref & r) : GenNode((GenNode const&)r) { }
GenNode(Ref && r) : GenNode((GenNode &&)r) { }
GenNode& operator= (GenNode const&) =default;
GenNode& operator= (GenNode&&) =default;

View file

@ -55,6 +55,68 @@ namespace diff{
: public TreeDiffInterpreter
{
/* == Implementation of the list diff application primitives == */
void
ins (GenNode n) override
{
UNIMPLEMENTED("insert node");
}
void
del (GenNode n) override
{
UNIMPLEMENTED("delete next node");
}
void
pick (GenNode n) override
{
UNIMPLEMENTED("accept next node as-is");
}
void
skip (GenNode n) override
{
UNIMPLEMENTED("skip void position left by find");
} // assume the actual content has been moved away by a previous find()
void
find (GenNode n) override
{
UNIMPLEMENTED("search the named node and insert it here");
} // consume and leave waste, expected to be cleaned-up by skip() later
/* == Implementation of the tree diff application primitives == */
void
after (GenNode n) override
{
UNIMPLEMENTED("cue to a position behind the named node");
}
void
mut (GenNode n) override
{
UNIMPLEMENTED("open nested context for diff");
}
void
emu (GenNode n) override
{
UNIMPLEMENTED("finish and leave nested diff context");
}
public:
explicit
DiffApplicationStrategy(Rec& targetRecord)
{
UNIMPLEMENTED();
}
};

View file

@ -42,6 +42,7 @@
#include "lib/diff/diff-language.hpp"
#include "lib/diff/list-diff.hpp"
#include "lib/diff/gen-node.hpp"
@ -60,11 +61,38 @@ namespace diff{
class TreeDiffInterpreter
{
public:
using Val = GenNode;
///////TODO actual operations go here
virtual ~TreeDiffInterpreter() { } ///< this is an interface
virtual void ins (GenNode n) =0;
virtual void del (GenNode n) =0;
virtual void pick(GenNode n) =0;
virtual void find(GenNode n) =0;
virtual void skip(GenNode n) =0;
virtual void after(GenNode n) =0;
virtual void mut (GenNode n) =0;
virtual void emu (GenNode n) =0;
};
using TreeDiffLanguage = DiffLanguage<TreeDiffInterpreter, GenNode>;
struct TreeDiffLanguage
: DiffLanguage<TreeDiffInterpreter, GenNode>
{
using Interpreter = TreeDiffInterpreter;
// List Diff sub language
DiffStep_CTOR(ins);
DiffStep_CTOR(del);
DiffStep_CTOR(pick);
DiffStep_CTOR(find);
DiffStep_CTOR(skip);
// Tree structure verbs
DiffStep_CTOR(after);
DiffStep_CTOR(mut);
DiffStep_CTOR(emu);
};

View file

@ -68,6 +68,8 @@ namespace test{
DiffStep_CTOR(pick);
DiffStep_CTOR(find);
DiffStep_CTOR(skip);
DiffStep_CTOR(after);
DiffStep_CTOR(mut);
DiffStep_CTOR(emu);