rippled
UnorderedContainers.h
1 //------------------------------------------------------------------------------
2 /*
3  This file is part of rippled: https://github.com/ripple/rippled
4  Copyright (c) 2012, 2013 Ripple Labs Inc.
5 
6  Permission to use, copy, modify, and/or distribute this software for any
7  purpose with or without fee is hereby granted, provided that the above
8  copyright notice and this permission notice appear in all copies.
9 
10  THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11  WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12  MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13  ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14  WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15  ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16  OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17 */
18 //==============================================================================
19 
20 #ifndef RIPPLE_BASICS_UNORDEREDCONTAINERS_H_INCLUDED
21 #define RIPPLE_BASICS_UNORDEREDCONTAINERS_H_INCLUDED
22 
23 #include <ripple/basics/hardened_hash.h>
24 #include <ripple/beast/hash/hash_append.h>
25 #include <ripple/beast/hash/uhash.h>
26 #include <ripple/beast/hash/xxhasher.h>
27 #include <unordered_map>
28 #include <unordered_set>
29 
42 namespace ripple {
43 
44 // hash containers
45 
46 template <
47  class Key,
48  class Value,
49  class Hash = beast::uhash<>,
50  class Pred = std::equal_to<Key>,
53 
54 template <
55  class Key,
56  class Value,
57  class Hash = beast::uhash<>,
58  class Pred = std::equal_to<Key>,
60 using hash_multimap =
62 
63 template <
64  class Value,
65  class Hash = beast::uhash<>,
66  class Pred = std::equal_to<Value>,
67  class Allocator = std::allocator<Value>>
69 
70 template <
71  class Value,
72  class Hash = beast::uhash<>,
73  class Pred = std::equal_to<Value>,
74  class Allocator = std::allocator<Value>>
76 
77 // hardened_hash containers
78 
80 
81 template <
82  class Key,
83  class Value,
84  class Hash = hardened_hash<strong_hash>,
85  class Pred = std::equal_to<Key>,
88 
89 template <
90  class Key,
91  class Value,
92  class Hash = hardened_hash<strong_hash>,
93  class Pred = std::equal_to<Key>,
97 
98 template <
99  class Value,
100  class Hash = hardened_hash<strong_hash>,
101  class Pred = std::equal_to<Value>,
102  class Allocator = std::allocator<Value>>
104 
105 template <
106  class Value,
107  class Hash = hardened_hash<strong_hash>,
108  class Pred = std::equal_to<Value>,
109  class Allocator = std::allocator<Value>>
112 
113 } // namespace ripple
114 
115 #endif
unordered_set
beast::xxhasher
Definition: xxhasher.h:30
std::unordered_multimap
STL class.
ripple::hardened_hash
Seed functor once per construction.
Definition: hardened_hash.h:96
std::unordered_multiset
STL class.
std::equal_to
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: RCLCensorshipDetector.h:29
std::allocator
STL class.
beast::uhash<>
unordered_map