From da148e9758cac90338f5169b4f70b2bcf0a95f5c Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Fri, 3 Jul 2015 18:21:46 +0200 Subject: [PATCH] WIP: equality comparisons for GenNode forwarding equality to the embedded EntryID Basically, two GenNodes are equal when they have the same "identity" Ironically, this is the usual twist with database entities --- src/lib/diff/gen-node.hpp | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/lib/diff/gen-node.hpp b/src/lib/diff/gen-node.hpp index 6c5e81b49..947fcfc4b 100644 --- a/src/lib/diff/gen-node.hpp +++ b/src/lib/diff/gen-node.hpp @@ -184,6 +184,9 @@ namespace diff{ // standard copy operations acceptable }; + + //------GenNode Data fields--- + ID idi; DataCap data; @@ -232,6 +235,19 @@ namespace diff{ return node.idi.getSym(); } + friend bool + operator== (GenNode const& n1, GenNode const& n2) + { + return n1.idi == n2.idi; + } + + friend bool + operator!= (GenNode const& n1, GenNode const& n2) + { + return n1.idi != n2.idi; + } + + private: template static string