summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick Venture <venture@google.com>2018-06-14 09:24:42 -0700
committerPatrick Venture <venture@google.com>2018-06-14 09:26:42 -0700
commitbd6b476a0c080bd1aca4c963f09c3f08a87c83d8 (patch)
tree4b6695926fe7d7820162e3c679f6aa99c07b4aef
parentfe75b19359cde97397dc1548ea24ab90c4efa673 (diff)
downloadphosphor-pid-control-bd6b476a0c080bd1aca4c963f09c3f08a87c83d8.tar.gz
phosphor-pid-control-bd6b476a0c080bd1aca4c963f09c3f08a87c83d8.zip
interfaces: add equality operator for ReadReturn
Comparing ReadReturns where we have perfect knowledge should just use an equality operation. Change-Id: I93ee5d911e2e1f15330734031666edb2c9ef5457 Signed-off-by: Patrick Venture <venture@google.com>
-rw-r--r--interfaces.hpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/interfaces.hpp b/interfaces.hpp
index 8e7fc0b..c16d19e 100644
--- a/interfaces.hpp
+++ b/interfaces.hpp
@@ -6,6 +6,10 @@
struct ReadReturn {
double value;
std::chrono::high_resolution_clock::time_point updated;
+
+ bool operator==(const ReadReturn &rhs) const {
+ return (this->value == rhs.value && this->updated == rhs.updated);
+ }
};
OpenPOWER on IntegriCloud