@@ -55,18 +55,44 @@ class RemoteAddress {
55
55
return !operator ==(other);
56
56
}
57
57
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
+
58
66
bool operator <(const RemoteAddress rhs) const {
59
67
assert (AddressSpace == rhs.AddressSpace &&
60
68
" Comparing remote addresses of different address spaces" );
61
69
return Data < rhs.Data ;
62
70
}
63
71
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
+
64
81
bool operator <=(const RemoteAddress rhs) const {
65
82
assert (AddressSpace == rhs.AddressSpace &&
66
83
" Comparing remote addresses of different address spaces" );
67
84
return Data <= rhs.Data ;
68
85
}
69
86
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
+
70
96
bool operator >(const RemoteAddress &rhs) const {
71
97
assert (AddressSpace == rhs.AddressSpace &&
72
98
" Comparing remote addresses of different address spaces" );
0 commit comments