1#ifndef XRPL_PROTOCOL_BOOK_H_INCLUDED
2#define XRPL_PROTOCOL_BOOK_H_INCLUDED
4#include <xrpl/basics/CountedObject.h>
5#include <xrpl/basics/base_uint.h>
6#include <xrpl/protocol/Issue.h>
8#include <boost/utility/base_from_member.hpp>
45template <
class Hasher>
60[[nodiscard]]
inline constexpr bool
63 return (lhs.
in == rhs.
in) && (lhs.
out == rhs.
out) &&
73 if (
auto const c{lhs.
in <=> rhs.
in}; c != 0)
75 if (
auto const c{lhs.
out <=> rhs.
out}; c != 0)
82 return std::weak_ordering::less;
84 return std::weak_ordering::greater;
86 return std::weak_ordering::equivalent;
98 :
private boost::base_from_member<std::hash<ripple::Currency>, 0>,
99 private boost::base_from_member<std::hash<ripple::AccountID>, 1>
103 boost::base_from_member<std::hash<ripple::Currency>, 0>;
105 boost::base_from_member<std::hash<ripple::AccountID>, 1>;
119 result, issuer_hash_type::member(value.
account));
146 boost::hash_combine(result, m_issue_hasher(value.
out));
149 boost::hash_combine(result, m_uint256_hasher(*value.
domain));
std::optional< uint256 > domain
Book(Issue const &in_, Issue const &out_, std::optional< uint256 > const &domain_)
Tracks the number of instances of an object.
A currency issued by an account.
hardened_hash<> hasher
Value hashing function.
Seed functor once per construction.
std::enable_if_t< is_contiguously_hashable< T, Hasher >::value > hash_append(Hasher &h, T const &t) noexcept
Logically concatenate input data to a Hasher.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
void hash_append(Hasher &h, Slice const &v)
bool isConsistent(Book const &book)
constexpr std::strong_ordering operator<=>(base_uint< Bits, Tag > const &lhs, base_uint< Bits, Tag > const &rhs)
Book reversed(Book const &book)
std::ostream & operator<<(std::ostream &out, base_uint< Bits, Tag > const &u)
std::string to_string(base_uint< Bits, Tag > const &a)
constexpr bool operator==(base_uint< Bits, Tag > const &lhs, base_uint< Bits, Tag > const &rhs)
value_type operator()(argument_type const &value) const
uint256_hasher m_uint256_hasher
issue_hasher m_issue_hasher
boost::base_from_member< std::hash< ripple::AccountID >, 1 > issuer_hash_type
value_type operator()(argument_type const &value) const
boost::base_from_member< std::hash< ripple::Currency >, 0 > currency_hash_type