OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 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 #ifndef NET_BASE_PRIORITY_QUEUE_H_ | 5 #ifndef NET_BASE_PRIORITY_QUEUE_H_ |
6 #define NET_BASE_PRIORITY_QUEUE_H_ | 6 #define NET_BASE_PRIORITY_QUEUE_H_ |
7 | 7 |
8 #include <stddef.h> | 8 #include <stddef.h> |
9 #include <stdint.h> | 9 #include <stdint.h> |
10 | 10 |
11 #include <list> | 11 #include <list> |
12 #include <vector> | 12 #include <vector> |
13 | 13 |
14 #include "base/logging.h" | 14 #include "base/logging.h" |
15 #include "base/macros.h" | 15 #include "base/macros.h" |
16 #include "base/threading/non_thread_safe.h" | 16 #include "base/threading/non_thread_safe.h" |
17 #include "net/base/net_export.h" | |
18 | 17 |
19 #if !defined(NDEBUG) | 18 #if !defined(NDEBUG) |
20 #include <unordered_set> | 19 #include <unordered_set> |
21 #endif | 20 #endif |
22 | 21 |
23 namespace net { | 22 namespace net { |
24 | 23 |
25 // A simple priority queue. The order of values is by priority and then FIFO. | 24 // A simple priority queue. The order of values is by priority and then FIFO. |
26 // Unlike the std::priority_queue, this implementation allows erasing elements | 25 // Unlike the std::priority_queue, this implementation allows erasing elements |
27 // from the queue, and all operations are O(p) time for p priority levels. | 26 // from the queue, and all operations are O(p) time for p priority levels. |
(...skipping 277 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
305 | 304 |
306 ListVector lists_; | 305 ListVector lists_; |
307 size_t size_; | 306 size_t size_; |
308 | 307 |
309 DISALLOW_COPY_AND_ASSIGN(PriorityQueue); | 308 DISALLOW_COPY_AND_ASSIGN(PriorityQueue); |
310 }; | 309 }; |
311 | 310 |
312 } // namespace net | 311 } // namespace net |
313 | 312 |
314 #endif // NET_BASE_PRIORITY_QUEUE_H_ | 313 #endif // NET_BASE_PRIORITY_QUEUE_H_ |
OLD | NEW |