mirror of
https://github.com/XRPLF/rippled.git
synced 2025-11-19 18:45:52 +00:00
Start to flesh out this code.
This commit is contained in:
41
SHAMap.cpp
Normal file
41
SHAMap.cpp
Normal file
@@ -0,0 +1,41 @@
|
||||
#include "BitcoinUtil.h"
|
||||
#include "SHAMap.h"
|
||||
|
||||
bool SHAMapNodeID::operator<(const SHAMapNodeID &s) const
|
||||
{
|
||||
if(s.mDepth<mDepth) return true;
|
||||
if(s.mDepth>mDepth) return false;
|
||||
return mNodeID<s.mNodeID;
|
||||
}
|
||||
|
||||
bool SHAMapNodeID::operator>(const SHAMapNodeID &s) const
|
||||
{
|
||||
if(s.mDepth<mDepth) return false;
|
||||
if(s.mDepth>mDepth) return true;
|
||||
return mNodeID>s.mNodeID;
|
||||
}
|
||||
|
||||
bool SHAMapNodeID::operator<=(const SHAMapNodeID &s) const
|
||||
{
|
||||
if(s.mDepth<mDepth) return true;
|
||||
if(s.mDepth>mDepth) return false;
|
||||
return mNodeID<=s.mNodeID;
|
||||
}
|
||||
|
||||
bool SHAMapNodeID::operator>=(const SHAMapNodeID &s) const
|
||||
{
|
||||
if(s.mDepth<mDepth) return false;
|
||||
if(s.mDepth>mDepth) return true;
|
||||
return mNodeID>=s.mNodeID;
|
||||
}
|
||||
|
||||
bool SHAMapNodeID::operator==(const SHAMapNodeID &s) const
|
||||
{
|
||||
return (s.mDepth==mDepth) && (s.mNodeID==mNodeID);
|
||||
}
|
||||
|
||||
bool SHAMapNodeID::operator!=(const SHAMapNodeID &s) const
|
||||
{
|
||||
return (s.mDepth!=mDepth) || (s.mNodeID!=mNodeID);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user