TreeMutator: provide no-op implementation
how to further your career with eight simple steps
This commit is contained in:
parent
fb93e349da
commit
0d5f29446b
2 changed files with 40 additions and 15 deletions
|
|
@ -70,18 +70,34 @@ namespace diff{
|
|||
* Diff binding for black holes, happily accepting anything.
|
||||
* @note absorbs and silently ignores any diff verb.
|
||||
*/
|
||||
template<class PAR>
|
||||
class BlackHoleMutation
|
||||
: public PAR
|
||||
: public TreeMutator
|
||||
{
|
||||
|
||||
|
||||
public:
|
||||
BlackHoleMutation (PAR&& chain)
|
||||
: PAR{std::forward<PAR>(chain)}
|
||||
{ }
|
||||
BlackHoleMutation () = default;
|
||||
|
||||
|
||||
/* ==== TreeMutator API ==== */
|
||||
|
||||
using Elm = GenNode const&;
|
||||
using Buff = TreeMutator::Handle;
|
||||
|
||||
bool hasSrc() override { return true; } ///< always keen to do yet more
|
||||
|
||||
bool injectNew (Elm) override { return true; } ///< pretend to inject a new element
|
||||
bool matchSrc (Elm) override { return true; } ///< purport suitable element is waiting
|
||||
bool acceptSrc (Elm) override { return true; } ///< claim to handle any diff task
|
||||
bool accept_until (Elm) override { return true; } ///< profess to forward anywhere
|
||||
bool findSrc (Elm) override { return true; } ///< sham to find anything
|
||||
bool assignElm (Elm) override { return true; } ///< accept any assignment
|
||||
|
||||
bool
|
||||
mutateChild (Elm, Buff buff) override ///< bluff to care for children, while just reproducing ourselves
|
||||
{
|
||||
buff.create (BlackHoleMutation());
|
||||
return true;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
|
|
@ -91,7 +107,7 @@ namespace diff{
|
|||
inline auto
|
||||
Builder<PAR>::ignoreAllChanges()
|
||||
{
|
||||
return chainedBuilder<BlackHoleMutation<PAR>>();
|
||||
return Builder<BlackHoleMutation> (BlackHoleMutation{});
|
||||
}
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -16549,8 +16549,8 @@
|
|||
</node>
|
||||
<node CREATED="1539270808827" ID="ID_1352270227" MODIFIED="1539270817730" TEXT="für TimelineGui">
|
||||
<linktarget COLOR="#a9b4c1" DESTINATION="ID_1352270227" ENDARROW="Default" ENDINCLINATION="117;0;" ID="Arrow_ID_1672775567" SOURCE="ID_1624846094" STARTARROW="None" STARTINCLINATION="117;0;"/>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1539294555064" HGAP="45" ID="ID_1365984217" MODIFIED="1539294575340" TEXT="Problem: diff ignorieren" VSHIFT="23">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1539294555064" HGAP="45" ID="ID_1365984217" MODIFIED="1539299038616" TEXT="Problem: diff ignorieren" VSHIFT="23">
|
||||
<icon BUILTIN="messagebox_warning"/>
|
||||
<node CREATED="1539294576338" ID="ID_485684974" MODIFIED="1539294587881" TEXT="kann das auftreten....?">
|
||||
<icon BUILTIN="help"/>
|
||||
<node CREATED="1539294589200" ID="ID_1206613848" MODIFIED="1539294592657" TEXT="ja">
|
||||
|
|
@ -16579,10 +16579,10 @@
|
|||
<node CREATED="1539294678444" ID="ID_934706379" MODIFIED="1539294693604" TEXT="TreeMutator scheitert per Default">
|
||||
<icon BUILTIN="broken-line"/>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1539294698801" ID="ID_1533611583" MODIFIED="1539294720527" TEXT="also brauche ich einen /dev/null-Mutator">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1539294727470" ID="ID_1958316881" MODIFIED="1539294738485" TEXT="speziellen Binding-Layer fabrizieren">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1539294698801" ID="ID_1533611583" MODIFIED="1539299026168" TEXT="also brauche ich einen /dev/null-Mutator">
|
||||
<icon BUILTIN="pencil"/>
|
||||
<node COLOR="#338800" CREATED="1539294727470" ID="ID_1958316881" MODIFIED="1539299017213" TEXT="speziellen Binding-Layer fabrizieren">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
<node CREATED="1539294807066" ID="ID_1137741867" MODIFIED="1539294809654" TEXT="wie?"/>
|
||||
<node CREATED="1539294812306" ID="ID_1564927840" MODIFIED="1539294826763" TEXT="muß das Standard-Mapping anschauen"/>
|
||||
<node CREATED="1539294846845" ID="ID_1839295475" MODIFIED="1539294935855" TEXT="TreeDiffMutatorBinding">
|
||||
|
|
@ -16596,8 +16596,8 @@
|
|||
<node CREATED="1539294909749" ID="ID_1965063755" MODIFIED="1539294918319" TEXT="Impl in tree-diff.cpp">
|
||||
<icon BUILTIN="idea"/>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#fdfdcf" COLOR="#ff0000" CREATED="1539294950567" ID="ID_1321971857" MODIFIED="1539294956088" TEXT="alle Fälle durchklappern">
|
||||
<icon BUILTIN="flag-pink"/>
|
||||
<node COLOR="#338800" CREATED="1539294950567" ID="ID_1321971857" MODIFIED="1539298935822" TEXT="alle Fälle durchklappern">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
|
|
@ -16606,6 +16606,15 @@
|
|||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1539294760464" ID="ID_1376112641" MODIFIED="1539294792408" TEXT="DiffIgnoreChanges_test">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
<node COLOR="#338800" CREATED="1539298953819" ID="ID_1706428916" MODIFIED="1539298972769" TEXT="leerer TreeMutator produziert Fehler">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
</node>
|
||||
<node COLOR="#338800" CREATED="1539298974312" ID="ID_986781359" MODIFIED="1539298992271" TEXT="BlackHoleMutation frißt alles">
|
||||
<icon BUILTIN="button_ok"/>
|
||||
</node>
|
||||
<node BACKGROUND_COLOR="#eee5c3" COLOR="#990000" CREATED="1539298993222" ID="ID_647799125" MODIFIED="1539299007509" TEXT="Kombinieren mit speziellem Overlay">
|
||||
<icon BUILTIN="flag-yellow"/>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
</node>
|
||||
|
|
|
|||
Loading…
Reference in a new issue