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 <list> | 8 #include <list> |
9 #include <vector> | 9 #include <vector> |
10 | 10 |
11 #include "base/basictypes.h" | 11 #include "base/basictypes.h" |
12 #include "base/logging.h" | 12 #include "base/logging.h" |
13 #include "base/threading/non_thread_safe.h" | 13 #include "base/threading/non_thread_safe.h" |
14 #include "net/base/net_export.h" | 14 #include "net/base/net_export.h" |
15 | 15 |
16 #if !defined(NDEBUG) | 16 #if !defined(NDEBUG) |
17 #include "base/hash_tables.h" | 17 #include "base/containers/hash_tables.h" |
18 #endif | 18 #endif |
19 | 19 |
20 namespace net { | 20 namespace net { |
21 | 21 |
22 // A simple priority queue. The order of values is by priority and then FIFO. | 22 // A simple priority queue. The order of values is by priority and then FIFO. |
23 // Unlike the std::priority_queue, this implementation allows erasing elements | 23 // Unlike the std::priority_queue, this implementation allows erasing elements |
24 // from the queue, and all operations are O(p) time for p priority levels. | 24 // from the queue, and all operations are O(p) time for p priority levels. |
25 // The queue is agnostic to priority ordering (whether 0 precedes 1). | 25 // The queue is agnostic to priority ordering (whether 0 precedes 1). |
26 // If the highest priority is 0, FirstMin() returns the first in order. | 26 // If the highest priority is 0, FirstMin() returns the first in order. |
27 // | 27 // |
(...skipping 201 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
229 | 229 |
230 ListVector lists_; | 230 ListVector lists_; |
231 size_t size_; | 231 size_t size_; |
232 | 232 |
233 DISALLOW_COPY_AND_ASSIGN(PriorityQueue); | 233 DISALLOW_COPY_AND_ASSIGN(PriorityQueue); |
234 }; | 234 }; |
235 | 235 |
236 } // namespace net | 236 } // namespace net |
237 | 237 |
238 #endif // NET_BASE_PRIORITY_QUEUE_H_ | 238 #endif // NET_BASE_PRIORITY_QUEUE_H_ |
OLD | NEW |