From 5af47c6df585da03b1931a6c13ce72f0ccb28204 Mon Sep 17 00:00:00 2001 From: Teon Banek Date: Thu, 14 Feb 2019 16:34:54 +0100 Subject: [PATCH] Don't inherit TotalOrdering for RecordAccessor Summary: RecordAccessor doesn't implement `operator<`, so it doesn't make sense to have it inherit TotalOrdering. Reviewers: mferencevic, msantl, vkasljevic Reviewed By: vkasljevic Subscribers: pullbot Differential Revision: https://phabricator.memgraph.io/D1866 --- src/storage/distributed/record_accessor.hpp | 7 +++++-- src/storage/single_node/record_accessor.hpp | 7 +++++-- src/storage/single_node_ha/record_accessor.hpp | 7 +++++-- 3 files changed, 15 insertions(+), 6 deletions(-) diff --git a/src/storage/distributed/record_accessor.hpp b/src/storage/distributed/record_accessor.hpp index 4bc98994c..fb41eee10 100644 --- a/src/storage/distributed/record_accessor.hpp +++ b/src/storage/distributed/record_accessor.hpp @@ -9,7 +9,6 @@ #include "storage/common/types/types.hpp" #include "storage/distributed/address.hpp" #include "storage/distributed/gid.hpp" -#include "utils/total_ordering.hpp" namespace database { class GraphDbAccessor; @@ -26,7 +25,7 @@ struct StateDelta; * @tparam TRecord Type of record (MVCC Version) of the accessor. */ template -class RecordAccessor : public utils::TotalOrdering> { +class RecordAccessor { public: using AddressT = storage::Address>; @@ -71,6 +70,10 @@ class RecordAccessor : public utils::TotalOrdering> { bool operator==(const RecordAccessor &other) const; + bool operator!=(const RecordAccessor &other) const { + return !(*this == other); + } + /** Returns a GraphDB accessor of this record accessor. */ database::GraphDbAccessor &db_accessor() const; diff --git a/src/storage/single_node/record_accessor.hpp b/src/storage/single_node/record_accessor.hpp index 7cf3dfb02..277391f75 100644 --- a/src/storage/single_node/record_accessor.hpp +++ b/src/storage/single_node/record_accessor.hpp @@ -8,7 +8,6 @@ #include "storage/common/types/property_value_store.hpp" #include "storage/common/types/types.hpp" #include "storage/single_node/gid.hpp" -#include "utils/total_ordering.hpp" namespace database { class GraphDbAccessor; @@ -25,7 +24,7 @@ struct StateDelta; * @tparam TRecord Type of record (MVCC Version) of the accessor. */ template -class RecordAccessor : public utils::TotalOrdering> { +class RecordAccessor { protected: /** * The database::GraphDbAccessor is friend to this accessor so it can @@ -69,6 +68,10 @@ class RecordAccessor : public utils::TotalOrdering> { bool operator==(const RecordAccessor &other) const; + bool operator!=(const RecordAccessor &other) const { + return !(*this == other); + } + /** Returns a GraphDB accessor of this record accessor. */ database::GraphDbAccessor &db_accessor() const; diff --git a/src/storage/single_node_ha/record_accessor.hpp b/src/storage/single_node_ha/record_accessor.hpp index eacbc45ad..d11c2e319 100644 --- a/src/storage/single_node_ha/record_accessor.hpp +++ b/src/storage/single_node_ha/record_accessor.hpp @@ -8,7 +8,6 @@ #include "storage/common/types/property_value_store.hpp" #include "storage/common/types/types.hpp" #include "storage/single_node_ha/gid.hpp" -#include "utils/total_ordering.hpp" namespace database { class GraphDbAccessor; @@ -25,7 +24,7 @@ struct StateDelta; * @tparam TRecord Type of record (MVCC Version) of the accessor. */ template -class RecordAccessor : public utils::TotalOrdering> { +class RecordAccessor { protected: /** * The database::GraphDbAccessor is friend to this accessor so it can @@ -69,6 +68,10 @@ class RecordAccessor : public utils::TotalOrdering> { bool operator==(const RecordAccessor &other) const; + bool operator!=(const RecordAccessor &other) const { + return !(*this == other); + } + /** Returns a GraphDB accessor of this record accessor. */ database::GraphDbAccessor &db_accessor() const;