]>
git.proxmox.com Git - ceph.git/blob - ceph/src/rocksdb/util/hash_containers.h
1 // Copyright (c) Facebook, Inc. and its affiliates. All Rights Reserved.
2 // This source code is licensed under both the GPLv2 (found in the
3 // COPYING file in the root directory) and Apache 2.0 License
4 // (found in the LICENSE.Apache file in the root directory).
6 // This header establishes compile-time pluggable implementations of hashed
7 // container structures, so that deployments have the option of minimal
8 // dependencies with ok performance (e.g. std::unordered_map) or more
9 // dependencies with optimized performance (e.g. folly::F14FastMap).
13 #include "rocksdb/rocksdb_namespace.h"
17 #include <folly/container/F14Map.h>
18 #include <folly/container/F14Set.h>
20 namespace ROCKSDB_NAMESPACE
{
22 template <typename K
, typename V
>
23 using UnorderedMap
= folly::F14FastMap
<K
, V
>;
25 template <typename K
, typename V
, typename H
>
26 using UnorderedMapH
= folly::F14FastMap
<K
, V
, H
>;
29 using UnorderedSet
= folly::F14FastSet
<K
>;
31 } // namespace ROCKSDB_NAMESPACE
35 #include <unordered_map>
36 #include <unordered_set>
38 namespace ROCKSDB_NAMESPACE
{
40 template <typename K
, typename V
>
41 using UnorderedMap
= std::unordered_map
<K
, V
>;
43 template <typename K
, typename V
, typename H
>
44 using UnorderedMapH
= std::unordered_map
<K
, V
, H
>;
47 using UnorderedSet
= std::unordered_set
<K
>;
49 } // namespace ROCKSDB_NAMESPACE