Home | History | Annotate | Download | only in gfx

Lines Matching refs:Break

20 // Each break stores the start position and value of its associated range.
21 // A solitary break at position 0 applies to the entire space [0, max_).
23 // The first break always has position 0, to ensure all positions have a value.
24 // The value of the terminal break applies to the range [break.first, max_).
25 // The value of other breaks apply to the range [break.first, (break+1).first).
29 // The break type and const iterator, typedef'ed for convenience.
30 typedef std::pair<size_t, T> Break;
31 typedef typename std::vector<Break>::const_iterator const_iterator;
33 // Initialize a break at position 0 with the default or supplied |value|.
37 const std::vector<Break>& breaks() const { return breaks_; }
39 // Clear the breaks and set a break at position 0 with the supplied |value|.
49 // Get the break applicable to |position| (at or preceeding |position|).
50 typename std::vector<Break>::iterator GetBreak(size_t position);
51 typename std::vector<Break>::const_iterator GetBreak(size_t position) const;
53 // Get the range of the supplied break; returns the break's start position and
54 // the next break's start position (or |max_| for the terminal break).
59 bool EqualsForTesting(const std::vector<Break>& breaks) const;
67 std::vector<Break> breaks_;
72 BreakList<T>::BreakList() : breaks_(1, Break(0, T())), max_(0) {
76 BreakList<T>::BreakList(T value) : breaks_(1, Break(0, value)), max_(0) {
82 breaks_.push_back(Break(0, value));
94 typename std::vector<Break>::iterator start = GetBreak(range.start());
96 typename std::vector<Break>::iterator end = GetBreak(range.end());
98 typename std::vector<Break>::iterator i =
101 i = breaks_.insert(i, Break(range.start(), value)) + 1;
103 breaks_.insert(i, Break(range.end(), trailing_value));
112 typename std::vector<Break>::iterator i = GetBreak(max);
125 typename std::vector<Break>::iterator i = breaks_.end() - 1;
133 typename std::vector<Break>::const_iterator i = breaks_.end() - 1;
147 return breaks_.size() == 1 && breaks_[0] == Break(0, value);
151 bool BreakList<T>::EqualsForTesting(const std::vector<Break>& breaks) const {
163 DCHECK_EQ(breaks_[0].first, 0U) << "The first break must be at position 0.";
165 DCHECK_LT(breaks_[i].first, breaks_[i + 1].first) << "Break out of order.";
166 DCHECK_NE(breaks_[i].second, breaks_[i + 1].second) << "Redundant break.";
169 DCHECK_LT(breaks_.back().first, max_) << "Break beyond max position.";