diff --git a/src/cpp/ripple/SHAMap.h b/src/cpp/ripple/SHAMap.h index 4adf29b631..30ad9e52d7 100644 --- a/src/cpp/ripple/SHAMap.h +++ b/src/cpp/ripple/SHAMap.h @@ -37,6 +37,9 @@ private: void setHash() const; +protected: + SHAMapNode(int depth, const uint256& id, bool) : mNodeID(id), mDepth(depth), mHash(0) { ; } + public: static const int rootDepth = 0; @@ -63,13 +66,14 @@ public: bool operator<(const SHAMapNode&) const; bool operator>(const SHAMapNode&) const; - bool operator==(const SHAMapNode&) const; - bool operator==(const uint256&) const; - bool operator!=(const SHAMapNode&) const; - bool operator!=(const uint256&) const; bool operator<=(const SHAMapNode&) const; bool operator>=(const SHAMapNode&) const; + bool operator==(const SHAMapNode& n) const { return (mDepth == n.mDepth) && (mNodeID == n.mNodeID); } + bool operator==(const uint256& n) const { return n == mNodeID; } + bool operator!=(const SHAMapNode& n) const { return (mDepth != n.mDepth) || (mNodeID != n.mNodeID); } + bool operator!=(const uint256& n) const { return n != mNodeID; } + virtual std::string getString() const; void dump() const;