Lines Matching refs:offset

19 	Value	offset;
22 Range(const Value& offset, const Value& size)
24 offset(offset),
31 return offset + size;
53 bool AddRange(const Value& offset,
56 bool RemoveRange(const Value& offset,
64 bool IntersectsWith(const Value& offset,
67 int32 InsertionIndex(const Value& offset) const;
106 return AddRange(range.offset, range.size);
110 /*! Adds the range starting at \a offset with size \a size.
119 RangeArray<Value>::AddRange(const Value& offset, const Value& size)
124 int32 index = InsertionIndex(offset);
127 Value endOffset = offset + size;
131 while (endIndex < count && RangeAt(endIndex).offset <= endOffset)
135 if (index > 0 && offset == RangeAt(index - 1).EndOffset())
140 return fRanges.Insert(RangeType(offset, size), index);
147 firstRange.offset = std::min(firstRange.offset, offset);
148 firstRange.size = endOffset - firstRange.offset;
161 return RemoveRange(range.offset, range.size);
165 /*! Removes the range starting at \a offset with size \a size.
178 RangeArray<Value>::RemoveRange(const Value& offset, const Value& size)
183 int32 index = InsertionIndex(offset);
186 Value endOffset = offset + size;
190 while (endIndex < count && RangeAt(endIndex).offset < endOffset)
202 int32 firstRemoveIndex = firstRange.offset >= offset ? index : index + 1;
212 firstRange.size = offset - firstRange.offset;
218 firstRange.size = offset - firstRange.offset;
222 lastRange.offset = endOffset;
245 return IntersectsWith(range.offset, range.size);
251 RangeArray<Value>::IntersectsWith(const Value& offset, const Value& size) const
253 int32 index = InsertionIndex(offset);
254 return index < CountRanges() && RangeAt(index).offset < offset + size;
258 /*! Returns the insertion index of a range starting at \a offset.
261 \a offset, the index of that range is returned. If \a offset lies in between
263 \a offset is returned. Otherwise \c CountRanges() is returned.
265 \return The insertion index for a range starting at \a offset.
269 RangeArray<Value>::InsertionIndex(const Value& offset) const
278 if (offset >= range.EndOffset())