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

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

Issue 2566473002: Fix include guards for QUIC files. (Closed)
Patch Set: Created 4 years 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/quic_address_mismatch.h » ('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 31 matching lines...) Expand 10 before | Expand all | Expand 10 after
42 // intervals.Add(Interval<int>(15, 35)); 42 // intervals.Add(Interval<int>(15, 35));
43 // // intervals has been coalesced. It now contains the single range [10,40). 43 // // intervals has been coalesced. It now contains the single range [10,40).
44 // EXPECT_EQ(1, intervals.Size()); 44 // EXPECT_EQ(1, intervals.Size());
45 // EXPECT_TRUE(intervals.Contains(Interval<int>(10, 40))); 45 // EXPECT_TRUE(intervals.Contains(Interval<int>(10, 40)));
46 // 46 //
47 // intervals.Difference(Interval<int>(10, 20)); 47 // intervals.Difference(Interval<int>(10, 20));
48 // // intervals should now contain the single range [20, 40). 48 // // intervals should now contain the single range [20, 40).
49 // EXPECT_EQ(1, intervals.Size()); 49 // EXPECT_EQ(1, intervals.Size());
50 // EXPECT_TRUE(intervals.Contains(Interval<int>(20, 40))); 50 // EXPECT_TRUE(intervals.Contains(Interval<int>(20, 40)));
51 51
52 #ifndef NET_QUIC_INTERVAL_SET_H_ 52 #ifndef NET_QUIC_CORE_INTERVAL_SET_H_
53 #define NET_QUIC_INTERVAL_SET_H_ 53 #define NET_QUIC_CORE_INTERVAL_SET_H_
54 54
55 #include <stddef.h> 55 #include <stddef.h>
56 56
57 #include <algorithm> 57 #include <algorithm>
58 #include <ostream> 58 #include <ostream>
59 #include <set> 59 #include <set>
60 #include <string> 60 #include <string>
61 #include <utility> 61 #include <utility>
62 #include <vector> 62 #include <vector>
63 63
(...skipping 784 matching lines...) Expand 10 before | Expand all | Expand 10 after
848 // Find() and Compact() methods. 848 // Find() and Compact() methods.
849 template <typename T> 849 template <typename T>
850 inline bool IntervalSet<T>::IntervalComparator::operator()( 850 inline bool IntervalSet<T>::IntervalComparator::operator()(
851 const Interval<T>& a, 851 const Interval<T>& a,
852 const Interval<T>& b) const { 852 const Interval<T>& b) const {
853 return (a.min() < b.min() || (a.min() == b.min() && a.max() > b.max())); 853 return (a.min() < b.min() || (a.min() == b.min() && a.max() > b.max()));
854 } 854 }
855 855
856 } // namespace net 856 } // namespace net
857 857
858 #endif // NET_QUIC_INTERVAL_SET_H_ 858 #endif // NET_QUIC_CORE_INTERVAL_SET_H_
OLDNEW
« no previous file with comments | « net/quic/core/interval.h ('k') | net/quic/core/quic_address_mismatch.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698