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/basics/partitioned_unordered_map.h>
25 #include <ripple/beast/hash/hash_append.h>
26 #include <ripple/beast/hash/uhash.h>
27 #include <ripple/beast/hash/xxhasher.h>
28 #include <unordered_map>
29 #include <unordered_set>
30 
43 namespace ripple {
44 
45 // hash containers
46 
47 template <
48  class Key,
49  class Value,
50  class Hash = beast::uhash<>,
51  class Pred = std::equal_to<Key>,
54 
55 template <
56  class Key,
57  class Value,
58  class Hash = beast::uhash<>,
59  class Pred = std::equal_to<Key>,
61 using hash_multimap =
63 
64 template <
65  class Value,
66  class Hash = beast::uhash<>,
67  class Pred = std::equal_to<Value>,
68  class Allocator = std::allocator<Value>>
70 
71 template <
72  class Value,
73  class Hash = beast::uhash<>,
74  class Pred = std::equal_to<Value>,
75  class Allocator = std::allocator<Value>>
77 
78 // hardened_hash containers
79 
81 
82 template <
83  class Key,
84  class Value,
85  class Hash = hardened_hash<strong_hash>,
86  class Pred = std::equal_to<Key>,
89 
90 template <
91  class Key,
92  class Value,
93  class Hash = hardened_hash<strong_hash>,
94  class Pred = std::equal_to<Key>,
98 
99 template <
100  class Key,
101  class Value,
102  class Hash = hardened_hash<strong_hash>,
103  class Pred = std::equal_to<Key>,
107 
108 template <
109  class Value,
110  class Hash = hardened_hash<strong_hash>,
111  class Pred = std::equal_to<Value>,
112  class Allocator = std::allocator<Value>>
114 
115 template <
116  class Value,
117  class Hash = hardened_hash<strong_hash>,
118  class Pred = std::equal_to<Value>,
119  class Allocator = std::allocator<Value>>
122 
123 } // namespace ripple
124 
125 #endif
unordered_set
beast::xxhasher
Definition: xxhasher.h:30
ripple::partitioned_unordered_map
Definition: partitioned_unordered_map.h:43
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