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