blob: 7cfb3117865720e43b47adac8d7b922d1e7a7955 [file] [log] [blame]
QUICHE teama6ef0a62019-03-07 20:34:33 -05001// 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
10namespace quic {
11
12// The default hasher used by hash tables.
13template <typename Key>
14using QuicDefaultHasher = QuicDefaultHasherImpl<Key>;
15
16// A general-purpose unordered map.
17template <typename Key, typename Value, typename Hash = QuicDefaultHasher<Key>>
18using QuicUnorderedMap = QuicUnorderedMapImpl<Key, Value, Hash>;
19
20// A general-purpose unordered set.
21template <typename Key, typename Hash = QuicDefaultHasher<Key>>
22using QuicUnorderedSet = QuicUnorderedSetImpl<Key, Hash>;
23
24// A map which offers insertion-ordered iteration.
25template <typename Key, typename Value, typename Hash = QuicDefaultHasher<Key>>
26using 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!
33template <typename Key, typename Value, int Size>
34using 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!
40template <typename T>
41using 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!
47template <typename T>
48using QuicDeque = QuicDequeImpl<T>;
49
50// A vector optimized for small sizes. Provides the same APIs as a std::vector.
51template <typename T, size_t N, typename A = std::allocator<T>>
52using QuicInlinedVector = QuicInlinedVectorImpl<T, N, A>;
53
54} // namespace quic
55
56#endif // QUICHE_QUIC_PLATFORM_API_QUIC_CONTAINERS_H_