QUICHE team | a6ef0a6 | 2019-03-07 20:34:33 -0500 | [diff] [blame] | 1 | // Copyright (c) 2017 The Chromium Authors. All rights reserved. |
| 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
| 5 | #ifndef QUICHE_QUIC_PLATFORM_API_QUIC_CONTAINERS_H_ |
| 6 | #define QUICHE_QUIC_PLATFORM_API_QUIC_CONTAINERS_H_ |
| 7 | |
| 8 | #include "net/quic/platform/impl/quic_containers_impl.h" |
| 9 | |
| 10 | namespace quic { |
| 11 | |
| 12 | // The default hasher used by hash tables. |
| 13 | template <typename Key> |
| 14 | using QuicDefaultHasher = QuicDefaultHasherImpl<Key>; |
| 15 | |
| 16 | // A general-purpose unordered map. |
| 17 | template <typename Key, typename Value, typename Hash = QuicDefaultHasher<Key>> |
| 18 | using QuicUnorderedMap = QuicUnorderedMapImpl<Key, Value, Hash>; |
| 19 | |
| 20 | // A general-purpose unordered set. |
| 21 | template <typename Key, typename Hash = QuicDefaultHasher<Key>> |
| 22 | using QuicUnorderedSet = QuicUnorderedSetImpl<Key, Hash>; |
| 23 | |
| 24 | // A map which offers insertion-ordered iteration. |
| 25 | template <typename Key, typename Value, typename Hash = QuicDefaultHasher<Key>> |
| 26 | using QuicLinkedHashMap = QuicLinkedHashMapImpl<Key, Value, Hash>; |
| 27 | |
| 28 | // Used for maps that are typically small, then it is faster than (for example) |
| 29 | // hash_map which is optimized for large data sets. QuicSmallMap upgrades itself |
| 30 | // automatically to a QuicSmallMapImpl-specified map when it runs out of space. |
| 31 | // |
| 32 | // DOES NOT GUARANTEE POINTER OR ITERATOR STABILITY! |
| 33 | template <typename Key, typename Value, int Size> |
| 34 | using QuicSmallMap = QuicSmallMapImpl<Key, Value, Size>; |
| 35 | |
| 36 | // Represents a simple queue which may be backed by a list or |
| 37 | // a flat circular buffer. |
| 38 | // |
| 39 | // DOES NOT GUARANTEE POINTER OR ITERATOR STABILITY! |
| 40 | template <typename T> |
| 41 | using QuicQueue = QuicQueueImpl<T>; |
| 42 | |
| 43 | // Represents a double-ended queue which may be backed by a list or |
| 44 | // a flat circular buffer. |
| 45 | // |
| 46 | // DOES NOT GUARANTEE POINTER OR ITERATOR STABILITY! |
| 47 | template <typename T> |
| 48 | using QuicDeque = QuicDequeImpl<T>; |
| 49 | |
| 50 | // A vector optimized for small sizes. Provides the same APIs as a std::vector. |
| 51 | template <typename T, size_t N, typename A = std::allocator<T>> |
| 52 | using QuicInlinedVector = QuicInlinedVectorImpl<T, N, A>; |
| 53 | |
| 54 | } // namespace quic |
| 55 | |
| 56 | #endif // QUICHE_QUIC_PLATFORM_API_QUIC_CONTAINERS_H_ |