xrpld
Toggle main menu visibility
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/uhash.h>
6
#include <xrpl/beast/hash/xxhasher.h>
7
8
#include <
functional
>
9
#include <
memory
>
10
#include <
unordered_map
>
11
#include <
unordered_set
>
12
#include <
utility
>
13
25
26
namespace
xrpl
{
27
28
// hash containers
29
30
template
<
31
class
Key,
32
class
Value,
33
class
Hash = beast::Uhash<>,
34
class
Pred = std::equal_to<Key>,
35
class
Allocator = std::allocator<std::pair<Key const, Value>>>
36
using
HashMap
=
std::unordered_map<Key, Value, Hash, Pred, Allocator>
;
37
38
template
<
39
class
Key,
40
class
Value,
41
class
Hash =
beast::Uhash<>
,
42
class
Pred =
std::equal_to<Key>
,
43
class
Allocator =
std::allocator<std::pair<Key const, Value>
>>
44
using
HashMultimap
=
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
HashSet
=
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
HashMultiset
=
std::unordered_multiset<Value, Hash, Pred, Allocator>
;
59
60
// hardened_hash containers
61
62
using
StrongHash
=
beast::Xxhasher
;
63
64
template
<
65
class
Key,
66
class
Value,
67
class
Hash =
HardenedHash<StrongHash>
,
68
class
Pred =
std::equal_to<Key>
,
69
class
Allocator =
std::allocator<std::pair<Key const, Value>
>>
70
using
HardenedHashMap
=
std::unordered_map<Key, Value, Hash, Pred, Allocator>
;
71
72
template
<
73
class
Key,
74
class
Value,
75
class
Hash =
HardenedHash<StrongHash>
,
76
class
Pred =
std::equal_to<Key>
,
77
class
Allocator =
std::allocator<std::pair<Key const, Value>
>>
78
using
HardenedPartitionedHashMap
=
PartitionedUnorderedMap<Key, Value, Hash, Pred, Allocator>
;
79
80
template
<
81
class
Key,
82
class
Value,
83
class
Hash =
HardenedHash<StrongHash>
,
84
class
Pred =
std::equal_to<Key>
,
85
class
Allocator =
std::allocator<std::pair<Key const, Value>
>>
86
using
HardenedHashMultimap
=
std::unordered_multimap<Key, Value, Hash, Pred, Allocator>
;
87
88
template
<
89
class
Value,
90
class
Hash =
HardenedHash<StrongHash>
,
91
class
Pred =
std::equal_to<Value>
,
92
class
Allocator =
std::allocator<Value>
>
93
using
HardenedHashSet
=
std::unordered_set<Value, Hash, Pred, Allocator>
;
94
95
template
<
96
class
Value,
97
class
Hash =
HardenedHash<StrongHash>
,
98
class
Pred =
std::equal_to<Value>
,
99
class
Allocator =
std::allocator<Value>
>
100
using
HardenedHashMultiset
=
std::unordered_multiset<Value, Hash, Pred, Allocator>
;
101
102
}
// namespace xrpl
std::allocator
beast::Xxhasher
Definition
xxhasher.h:19
xrpl::HardenedHash
Seed functor once per construction.
Definition
hardened_hash.h:72
xrpl::PartitionedUnorderedMap
Definition
partitioned_unordered_map.h:40
std::equal_to
functional
memory
xrpl
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition
algorithm.h:5
xrpl::HardenedHashMultiset
std::unordered_multiset< Value, Hash, Pred, Allocator > HardenedHashMultiset
Definition
UnorderedContainers.h:100
xrpl::StrongHash
beast::Xxhasher StrongHash
Definition
UnorderedContainers.h:62
xrpl::HardenedHashSet
std::unordered_set< Value, Hash, Pred, Allocator > HardenedHashSet
Definition
UnorderedContainers.h:93
xrpl::HashMultiset
std::unordered_multiset< Value, Hash, Pred, Allocator > HashMultiset
Definition
UnorderedContainers.h:58
xrpl::HardenedHashMap
std::unordered_map< Key, Value, Hash, Pred, Allocator > HardenedHashMap
Definition
UnorderedContainers.h:70
xrpl::HashSet
std::unordered_set< Value, Hash, Pred, Allocator > HashSet
Definition
UnorderedContainers.h:51
xrpl::HashMap
std::unordered_map< Key, Value, Hash, Pred, Allocator > HashMap
Definition
UnorderedContainers.h:36
xrpl::HashMultimap
std::unordered_multimap< Key, Value, Hash, Pred, Allocator > HashMultimap
Definition
UnorderedContainers.h:44
xrpl::HardenedHashMultimap
std::unordered_multimap< Key, Value, Hash, Pred, Allocator > HardenedHashMultimap
Definition
UnorderedContainers.h:86
xrpl::HardenedPartitionedHashMap
PartitionedUnorderedMap< Key, Value, Hash, Pred, Allocator > HardenedPartitionedHashMap
Definition
UnorderedContainers.h:78
beast::Uhash
Definition
uhash.h:11
unordered_map
std::unordered_multimap
std::unordered_multiset
unordered_set
utility
Generated by
1.17.0