rippled
Loading...
Searching...
No Matches
include
xrpl
basics
UnorderedContainers.h
1
#ifndef XRPL_BASICS_UNORDEREDCONTAINERS_H_INCLUDED
2
#define XRPL_BASICS_UNORDEREDCONTAINERS_H_INCLUDED
3
4
#include <xrpl/basics/hardened_hash.h>
5
#include <xrpl/basics/partitioned_unordered_map.h>
6
#include <xrpl/beast/hash/hash_append.h>
7
#include <xrpl/beast/hash/uhash.h>
8
#include <xrpl/beast/hash/xxhasher.h>
9
10
#include <
unordered_map
>
11
#include <
unordered_set
>
12
25
namespace
ripple
{
26
27
// hash containers
28
29
template
<
30
class
Key,
31
class
Value,
32
class
Hash =
beast::uhash<>
,
33
class
Pred =
std::equal_to<Key>
,
34
class
Allocator =
std::allocator<std::pair<Key const, Value>
>>
35
using
hash_map
=
std::unordered_map<Key, Value, Hash, Pred, Allocator>
;
36
37
template
<
38
class
Key,
39
class
Value,
40
class
Hash =
beast::uhash<>
,
41
class
Pred =
std::equal_to<Key>
,
42
class
Allocator =
std::allocator<std::pair<Key const, Value>
>>
43
using
hash_multimap
=
44
std::unordered_multimap<Key, Value, Hash, Pred, Allocator>
;
45
46
template
<
47
class
Value,
48
class
Hash =
beast::uhash<>
,
49
class
Pred =
std::equal_to<Value>
,
50
class
Allocator =
std::allocator<Value>
>
51
using
hash_set
=
std::unordered_set<Value, Hash, Pred, Allocator>
;
52
53
template
<
54
class
Value,
55
class
Hash =
beast::uhash<>
,
56
class
Pred =
std::equal_to<Value>
,
57
class
Allocator =
std::allocator<Value>
>
58
using
hash_multiset
=
std::unordered_multiset<Value, Hash, Pred, Allocator>
;
59
60
// hardened_hash containers
61
62
using
strong_hash
=
beast::xxhasher
;
63
64
template
<
65
class
Key,
66
class
Value,
67
class
Hash =
hardened_hash<strong_hash>
,
68
class
Pred =
std::equal_to<Key>
,
69
class
Allocator =
std::allocator<std::pair<Key const, Value>
>>
70
using
hardened_hash_map
=
std::unordered_map<Key, Value, Hash, Pred, Allocator>
;
71
72
template
<
73
class
Key,
74
class
Value,
75
class
Hash =
hardened_hash<strong_hash>
,
76
class
Pred =
std::equal_to<Key>
,
77
class
Allocator =
std::allocator<std::pair<Key const, Value>
>>
78
using
hardened_partitioned_hash_map
=
79
partitioned_unordered_map<Key, Value, Hash, Pred, Allocator>
;
80
81
template
<
82
class
Key,
83
class
Value,
84
class
Hash =
hardened_hash<strong_hash>
,
85
class
Pred =
std::equal_to<Key>
,
86
class
Allocator =
std::allocator<std::pair<Key const, Value>
>>
87
using
hardened_hash_multimap
=
88
std::unordered_multimap<Key, Value, Hash, Pred, Allocator>
;
89
90
template
<
91
class
Value,
92
class
Hash =
hardened_hash<strong_hash>
,
93
class
Pred =
std::equal_to<Value>
,
94
class
Allocator =
std::allocator<Value>
>
95
using
hardened_hash_set
=
std::unordered_set<Value, Hash, Pred, Allocator>
;
96
97
template
<
98
class
Value,
99
class
Hash =
hardened_hash<strong_hash>
,
100
class
Pred =
std::equal_to<Value>
,
101
class
Allocator =
std::allocator<Value>
>
102
using
hardened_hash_multiset
=
103
std::unordered_multiset<Value, Hash, Pred, Allocator>
;
104
105
}
// namespace ripple
106
107
#endif
std::allocator
beast::xxhasher
Definition
xxhasher.h:17
ripple::hardened_hash
Seed functor once per construction.
Definition
hardened_hash.h:74
ripple::partitioned_unordered_map
Definition
partitioned_unordered_map.h:38
std::equal_to
ripple
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition
algorithm.h:6
beast::uhash
Definition
uhash.h:12
unordered_map
std::unordered_multimap
std::unordered_multiset
unordered_set
Generated by
1.9.8