rippled
Loading...
Searching...
No Matches
UintTypes.h
1#ifndef XRPL_PROTOCOL_UINTTYPES_H_INCLUDED
2#define XRPL_PROTOCOL_UINTTYPES_H_INCLUDED
3
4#include <xrpl/basics/UnorderedContainers.h>
5#include <xrpl/basics/base_uint.h>
6#include <xrpl/beast/utility/Zero.h>
7#include <xrpl/protocol/AccountID.h>
8
9namespace ripple {
10namespace detail {
11
13{
14public:
15 explicit CurrencyTag() = default;
16};
17
19{
20public:
21 explicit DirectoryTag() = default;
22};
23
25{
26public:
27 explicit NodeIDTag() = default;
28};
29
30} // namespace detail
31
35
38
41
46
49
51Currency const&
53
55Currency const&
57
60Currency const&
62
63inline bool
64isXRP(Currency const& c)
65{
66 return c == beast::zero;
67}
68
71to_string(Currency const& c);
72
80bool
82
91
92inline std::ostream&
93operator<<(std::ostream& os, Currency const& x)
94{
95 os << to_string(x);
96 return os;
97}
98
99} // namespace ripple
100
101namespace std {
102
103template <>
105{
106 hash() = default;
107};
108
109template <>
111{
112 hash() = default;
113};
114
115template <>
117{
118 hash() = default;
119};
120
121template <>
123{
124 hash() = default;
125};
126
127} // namespace std
128
129#endif
Integers of any length that is a multiple of 32-bits.
Definition base_uint.h:67
hardened_hash<> hasher
Value hashing function.
Definition base_uint.h:151
Seed functor once per construction.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
Currency const & badCurrency()
We deliberately disallow the currency that looks like "XRP" because too many people were using it ins...
bool isXRP(AccountID const &c)
Definition AccountID.h:71
Currency const & noCurrency()
A placeholder for empty currencies.
std::ostream & operator<<(std::ostream &out, base_uint< Bits, Tag > const &u)
Definition base_uint.h:628
base_uint< 160, detail::CurrencyTag > Currency
Currency is a hash representing a specific currency.
Definition UintTypes.h:37
Currency const & xrpCurrency()
XRP currency.
std::string to_string(base_uint< Bits, Tag > const &a)
Definition base_uint.h:611
bool to_currency(Currency &, std::string const &)
Tries to convert a string to a Currency, returns true on success.
Definition UintTypes.cpp:65
STL namespace.