From 37cfdbb7e178cf54f2114f24fa00cc7bdcf5cf40 Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Thu, 9 Jun 2016 01:18:21 +0200 Subject: [PATCH] better name for nested handle type --- src/lib/diff/test-mutation-target.hpp | 2 +- src/lib/diff/tree-mutator-attribute-binding.hpp | 4 ++-- src/lib/diff/tree-mutator-collection-binding.hpp | 6 +++--- src/lib/diff/tree-mutator.hpp | 4 ++-- tests/library/diff/tree-mutator-binding-test.cpp | 10 +++++----- 5 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/lib/diff/test-mutation-target.hpp b/src/lib/diff/test-mutation-target.hpp index 892931745..6a45fc78a 100644 --- a/src/lib/diff/test-mutation-target.hpp +++ b/src/lib/diff/test-mutation-target.hpp @@ -501,7 +501,7 @@ namespace diff{ /** locate the designated target element and build a suitable * sub-mutator for this element into the provided target buffer */ virtual bool - mutateChild (GenNode const& spec, TreeMutator::MutatorBuffer targetBuff) + mutateChild (GenNode const& spec, TreeMutator::Handle targetBuff) { if (PAR::mutateChild (spec, targetBuff)) return true; diff --git a/src/lib/diff/tree-mutator-attribute-binding.hpp b/src/lib/diff/tree-mutator-attribute-binding.hpp index 5314b13d1..e40098511 100644 --- a/src/lib/diff/tree-mutator-attribute-binding.hpp +++ b/src/lib/diff/tree-mutator-attribute-binding.hpp @@ -271,7 +271,7 @@ : public AttributeBindingBase { - ASSERT_VALID_SIGNATURE (MUT, void(TreeMutator::MutatorBuffer)); + ASSERT_VALID_SIGNATURE (MUT, void(TreeMutator::Handle)); MUT mutatorBuilder_; @@ -287,7 +287,7 @@ * which is assumed to construct a nested TreeMutator into the provided Buffer, * able to deal with the nested attribute object referred by this binding */ virtual bool - mutateChild (GenNode const& spec, TreeMutator::MutatorBuffer targetBuff) override + mutateChild (GenNode const& spec, TreeMutator::Handle targetBuff) override { if (not this->isApplicable(spec)) return PAR::mutateChild(spec, targetBuff); diff --git a/src/lib/diff/tree-mutator-collection-binding.hpp b/src/lib/diff/tree-mutator-collection-binding.hpp index 86d0ce437..3a8b8cb93 100644 --- a/src/lib/diff/tree-mutator-collection-binding.hpp +++ b/src/lib/diff/tree-mutator-collection-binding.hpp @@ -96,7 +96,7 @@ ASSERT_VALID_SIGNATURE (CTR, Elm (GenNode const&)) ASSERT_VALID_SIGNATURE (SEL, bool(GenNode const&)) ASSERT_VALID_SIGNATURE (ASS, bool(Elm&, GenNode const&)) - ASSERT_VALID_SIGNATURE (MUT, bool(Elm&, GenNode::ID const&, TreeMutator::MutatorBuffer)) + ASSERT_VALID_SIGNATURE (MUT, bool(Elm&, GenNode::ID const&, TreeMutator::Handle)) Coll& collection; @@ -302,7 +302,7 @@ /** locate the designated target element and build a suitable * sub-mutator for this element into the provided target buffer */ virtual bool - mutateChild (GenNode const& spec, TreeMutator::MutatorBuffer targetBuff) + mutateChild (GenNode const& spec, TreeMutator::Handle targetBuff) { Iter target_found = binding_.locate (spec); return target_found? binding_.openSub (*target_found, spec.idi, targetBuff) @@ -466,7 +466,7 @@ } static bool - disable_childMutation (Elm&, GenNode::ID const&, TreeMutator::MutatorBuffer) + disable_childMutation (Elm&, GenNode::ID const&, TreeMutator::Handle) { return false; } diff --git a/src/lib/diff/tree-mutator.hpp b/src/lib/diff/tree-mutator.hpp index 242b96b5a..59e4ddc3c 100644 --- a/src/lib/diff/tree-mutator.hpp +++ b/src/lib/diff/tree-mutator.hpp @@ -271,7 +271,7 @@ namespace diff{ } - using MutatorBuffer = PlantingHandle; + using Handle = PlantingHandle; /** locate the designated target element * and build a suitable sub-mutator for this element @@ -279,7 +279,7 @@ namespace diff{ * @throw error::Fatal when buffer is insufficient * @return false when unable to locate the target */ virtual bool - mutateChild (GenNode const&, MutatorBuffer) + mutateChild (GenNode const&, Handle) { // do nothing by default return false; diff --git a/tests/library/diff/tree-mutator-binding-test.cpp b/tests/library/diff/tree-mutator-binding-test.cpp index 731556209..d3207550e 100644 --- a/tests/library/diff/tree-mutator-binding-test.cpp +++ b/tests/library/diff/tree-mutator-binding-test.cpp @@ -304,7 +304,7 @@ namespace test{ // implementation of TreeMutator without any further functionality. InPlaceBuffer subMutatorBuffer; - TreeMutator::MutatorBuffer placementHandle(subMutatorBuffer); + TreeMutator::Handle placementHandle(subMutatorBuffer); CHECK (mutator3.mutateChild (SUB_NODE, placementHandle)); // mutateChild CHECK (not subMutatorBuffer->hasSrc()); // ...this is all we can do here @@ -534,7 +534,7 @@ namespace test{ target.val = render(spec.data); return true; }) - .buildChildMutator ([&](Data& target, GenNode::ID const& subID, TreeMutator::MutatorBuffer buff) -> bool + .buildChildMutator ([&](Data& target, GenNode::ID const& subID, TreeMutator::Handle buff) -> bool { // use our "inside knowledge" to get at the nested scope implementation VecD& subScope = subScopes[subID]; @@ -575,7 +575,7 @@ namespace test{ // rather we invoke the operations on a nested mutator right from here. InPlaceBuffer subMutatorBuffer; - TreeMutator::MutatorBuffer placementHandle(subMutatorBuffer); + TreeMutator::Handle placementHandle(subMutatorBuffer); CHECK (mutator3.mutateChild (SUB_NODE, placementHandle)); // mutateChild @@ -834,7 +834,7 @@ namespace test{ LOG_SETTER ("gamma") gamma = val; }) - .mutateAttrib("δ", [&](TreeMutator::MutatorBuffer buff) + .mutateAttrib("δ", [&](TreeMutator::Handle buff) { // NOTE: we use "implementation inside knowledge" regarding the nested scope, // which is here represented as TestMutationTarget @@ -887,7 +887,7 @@ namespace test{ // use some suitable size here, not the point in focus for this test InPlaceBuffer subMutatorBuffer; - TreeMutator::MutatorBuffer placementHandle(subMutatorBuffer); + TreeMutator::Handle placementHandle(subMutatorBuffer); CHECK (mutator3.mutateChild (ATTRIB_NODE, placementHandle)); // mutateChild