Lines Matching refs:Range
27 class Range {
32 Range(uint32_t start, uint32_t end) : mStart(start), mEnd(end) {} in Range() function
33 Range() : Range(NOWHERE, NOWHERE) {} in Range() function
35 Range(const Range&) = default;
36 Range& operator=(const Range&) = default;
38 static Range invalidRange() { return Range(NOWHERE, NOWHERE); } in invalidRange()
55 inline std::pair<Range, Range> split(uint32_t pos) const { in split()
56 return std::make_pair(Range(mStart, pos), Range(pos, mEnd)); in split()
59 inline bool contains(const Range& other) const { in contains()
72 inline static bool intersects(const Range& left, const Range& right) { in intersects()
76 inline static Range intersection(const Range& left, const Range& right) { in intersection()
77 return Range(std::max(left.mStart, right.mStart), std::min(left.mEnd, right.mEnd)); in intersection()
82 static Range merge(const Range& left, const Range& right) { in merge()
83 return Range({std::min(left.mStart, right.mStart), std::max(left.mEnd, right.mEnd)}); in merge()
86 inline bool operator==(const Range& o) const { return mStart == o.mStart && mEnd == o.mEnd; }
88 inline bool operator!=(const Range& o) const { return !(*this == o); }
90 inline Range operator+(int32_t shift) const { return Range(mStart + shift, mEnd + shift); }
92 inline Range operator-(int32_t shift) const { return Range(mStart - shift, mEnd - shift); }