rippled
Loading...
Searching...
No Matches
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 <xrpl/basics/hardened_hash.h>
24#include <xrpl/basics/partitioned_unordered_map.h>
25#include <xrpl/beast/hash/hash_append.h>
26#include <xrpl/beast/hash/uhash.h>
27#include <xrpl/beast/hash/xxhasher.h>
28
29#include <unordered_map>
30#include <unordered_set>
31
44namespace ripple {
45
46// hash containers
47
48template <
49 class Key,
50 class Value,
51 class Hash = beast::uhash<>,
52 class Pred = std::equal_to<Key>,
55
56template <
57 class Key,
58 class Value,
59 class Hash = beast::uhash<>,
60 class Pred = std::equal_to<Key>,
64
65template <
66 class Value,
67 class Hash = beast::uhash<>,
68 class Pred = std::equal_to<Value>,
69 class Allocator = std::allocator<Value>>
71
72template <
73 class Value,
74 class Hash = beast::uhash<>,
75 class Pred = std::equal_to<Value>,
76 class Allocator = std::allocator<Value>>
78
79// hardened_hash containers
80
82
83template <
84 class Key,
85 class Value,
86 class Hash = hardened_hash<strong_hash>,
87 class Pred = std::equal_to<Key>,
90
91template <
92 class Key,
93 class Value,
94 class Hash = hardened_hash<strong_hash>,
95 class Pred = std::equal_to<Key>,
99
100template <
101 class Key,
102 class Value,
103 class Hash = hardened_hash<strong_hash>,
104 class Pred = std::equal_to<Key>,
108
109template <
110 class Value,
111 class Hash = hardened_hash<strong_hash>,
112 class Pred = std::equal_to<Value>,
113 class Allocator = std::allocator<Value>>
115
116template <
117 class Value,
118 class Hash = hardened_hash<strong_hash>,
119 class Pred = std::equal_to<Value>,
120 class Allocator = std::allocator<Value>>
123
124} // namespace ripple
125
126#endif
Seed functor once per construction.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:25