Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(365)

Side by Side Diff: net/quic/core/interval_set.h

Issue 2193073003: Move shared files in net/quic/ into net/quic/core/ (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: io_thread_unittest.cc Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « net/quic/core/interval.h ('k') | net/quic/core/interval_set_test.cc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 // 4 //
5 // IntervalSet<T> is a data structure used to represent a sorted set of 5 // IntervalSet<T> is a data structure used to represent a sorted set of
6 // non-empty, non-adjacent, and mutually disjoint intervals. Mutations to an 6 // non-empty, non-adjacent, and mutually disjoint intervals. Mutations to an
7 // interval set preserve these properties, altering the set as needed. For 7 // interval set preserve these properties, altering the set as needed. For
8 // example, adding [2, 3) to a set containing only [1, 2) would result in the 8 // example, adding [2, 3) to a set containing only [1, 2) would result in the
9 // set containing the single interval [1, 3). 9 // set containing the single interval [1, 3).
10 // 10 //
(...skipping 43 matching lines...) Expand 10 before | Expand all | Expand 10 after
54 54
55 #include <stddef.h> 55 #include <stddef.h>
56 56
57 #include <algorithm> 57 #include <algorithm>
58 #include <set> 58 #include <set>
59 #include <string> 59 #include <string>
60 #include <utility> 60 #include <utility>
61 #include <vector> 61 #include <vector>
62 62
63 #include "base/logging.h" 63 #include "base/logging.h"
64 #include "net/quic/interval.h" 64 #include "net/quic/core/interval.h"
65 65
66 namespace net { 66 namespace net {
67 67
68 template <typename T> 68 template <typename T>
69 class IntervalSet { 69 class IntervalSet {
70 private: 70 private:
71 struct IntervalComparator { 71 struct IntervalComparator {
72 bool operator()(const Interval<T>& a, const Interval<T>& b) const; 72 bool operator()(const Interval<T>& a, const Interval<T>& b) const;
73 }; 73 };
74 typedef std::set<Interval<T>, IntervalComparator> Set; 74 typedef std::set<Interval<T>, IntervalComparator> Set;
(...skipping 773 matching lines...) Expand 10 before | Expand all | Expand 10 after
848 template <typename T> 848 template <typename T>
849 inline bool IntervalSet<T>::IntervalComparator::operator()( 849 inline bool IntervalSet<T>::IntervalComparator::operator()(
850 const Interval<T>& a, 850 const Interval<T>& a,
851 const Interval<T>& b) const { 851 const Interval<T>& b) const {
852 return (a.min() < b.min() || (a.min() == b.min() && a.max() > b.max())); 852 return (a.min() < b.min() || (a.min() == b.min() && a.max() > b.max()));
853 } 853 }
854 854
855 } // namespace net 855 } // namespace net
856 856
857 #endif // NET_QUIC_INTERVAL_SET_H_ 857 #endif // NET_QUIC_INTERVAL_SET_H_
OLDNEW
« no previous file with comments | « net/quic/core/interval.h ('k') | net/quic/core/interval_set_test.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698