rippled
Loading...
Searching...
No Matches
SHAMapMissingNode.h
1#ifndef XRPL_SHAMAP_SHAMAPMISSINGNODE_H_INCLUDED
2#define XRPL_SHAMAP_SHAMAPMISSINGNODE_H_INCLUDED
3
4#include <xrpl/basics/base_uint.h>
5#include <xrpl/shamap/SHAMapTreeNode.h>
6
7#include <iosfwd>
8#include <stdexcept>
9#include <string>
10#include <type_traits>
11
12namespace ripple {
13
14enum class SHAMapType {
15 TRANSACTION = 1, // A tree of transactions
16 STATE = 2, // A tree of state nodes
17 FREE = 3, // A tree not part of a ledger
18};
19
20inline std::string
22{
23 switch (t)
24 {
26 return "Transaction Tree";
28 return "State Tree";
30 return "Free Tree";
31 default:
32 return std::to_string(
34 }
35}
36
38{
39public:
42 "Missing Node: " + to_string(t) + ": hash " + to_string(hash))
43 {
44 }
45
48 "Missing Node: " + to_string(t) + ": id " + to_string(id))
49 {
50 }
51};
52
53} // namespace ripple
54
55#endif
SHAMapMissingNode(SHAMapType t, uint256 const &id)
SHAMapMissingNode(SHAMapType t, SHAMapHash const &hash)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
constexpr std::enable_if_t< std::is_integral_v< Dest > &&std::is_integral_v< Src >, Dest > safe_cast(Src s) noexcept
Definition safe_cast.h:22
std::string to_string(base_uint< Bits, Tag > const &a)
Definition base_uint.h:611
STL namespace.
T to_string(T... args)