1#include <xrpl/ledger/BookDirs.h>
3#include <xrpl/beast/utility/Zero.h>
4#include <xrpl/beast/utility/instrumentation.h>
5#include <xrpl/ledger/ReadView.h>
6#include <xrpl/ledger/helpers/DirectoryHelpers.h>
7#include <xrpl/protocol/Book.h>
8#include <xrpl/protocol/Indexes.h>
20 XRPL_ASSERT(
root_ != beast::kZero,
"xrpl::BookDirs::BookDirs : nonzero root");
21 if (
key_ != beast::kZero)
26 UNREACHABLE(
"xrpl::BookDirs::BookDirs : directory is empty");
36 if (
key_ != beast::kZero)
55 if (
view_ ==
nullptr || other.
view_ ==
nullptr)
60 "xrpl::BookDirs::const_iterator::operator== : views and roots are "
69 index_ != beast::kZero,
"xrpl::BookDirs::const_iterator::operator* : nonzero index");
80 XRPL_ASSERT(
index_ != kZero,
"xrpl::BookDirs::const_iterator::operator++ : nonzero index");
95 UNREACHABLE(
"xrpl::BookDirs::const_iterator::operator++ : directory is empty");
108 index_ != beast::kZero,
"xrpl::BookDirs::const_iterator::operator++(int) : nonzero index");
std::optional< value_type > cache_
BookDirs(ReadView const &, Book const &)
uint256 const nextQuality_
const_iterator end() const
const_iterator begin() const
ConstIterator & operator++()
value_type const & reference
reference operator*() const
bool operator==(ConstIterator const &other) const
Keylet computation functions.
Keylet offer(AccountID const &id, std::uint32_t seq) noexcept
An offer from an account.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
uint256 getQualityNext(uint256 const &uBase)
uint256 getBookBase(Book const &book)
bool cdirNext(ReadView const &view, uint256 const &root, SLE::const_pointer &page, unsigned int &index, uint256 &entry)
Returns the next entry in the directory, advancing the index.
bool cdirFirst(ReadView const &view, uint256 const &root, SLE::const_pointer &page, unsigned int &index, uint256 &entry)
Returns the first entry in the directory, advancing the index.