@@ -55,18 +55,44 @@ class RemoteAddress {
5555 return !operator ==(other);
5656 }
5757
58+ bool inRange (const RemoteAddress &begin, const RemoteAddress &end) const {
59+ assert (begin.AddressSpace != end.AddressSpace &&
60+ " Unexpected address spaces" );
61+ if (AddressSpace != begin.AddressSpace )
62+ return false ;
63+ return begin <= *this && *this < end;
64+ }
65+
5866 bool operator <(const RemoteAddress rhs) const {
5967 assert (AddressSpace == rhs.AddressSpace &&
6068 " Comparing remote addresses of different address spaces" );
6169 return Data < rhs.Data ;
6270 }
6371
72+ // / Less than operator to be used for ordering purposes. The default less than
73+ // / operator asserts if the address spaces are different, this one takes it
74+ // / into account to determine the order of the addresses.
75+ bool orderedLessThan (const RemoteAddress rhs) const {
76+ if (AddressSpace == rhs.AddressSpace )
77+ return Data < rhs.Data ;
78+ return AddressSpace < rhs.AddressSpace ;
79+ }
80+
6481 bool operator <=(const RemoteAddress rhs) const {
6582 assert (AddressSpace == rhs.AddressSpace &&
6683 " Comparing remote addresses of different address spaces" );
6784 return Data <= rhs.Data ;
6885 }
6986
87+ // / Less than or equal operator to be used for ordering purposes. The default
88+ // / less than or equal operator asserts if the address spaces are different,
89+ // / this one takes it into account to determine the order of the addresses.
90+ bool orderedLessThanOrEqual (const RemoteAddress rhs) const {
91+ if (AddressSpace == rhs.AddressSpace )
92+ return Data <= rhs.Data ;
93+ return AddressSpace <= rhs.AddressSpace ;
94+ }
95+
7096 bool operator >(const RemoteAddress &rhs) const {
7197 assert (AddressSpace == rhs.AddressSpace &&
7298 " Comparing remote addresses of different address spaces" );
0 commit comments