21#include <xrpld/ledger/BookDirs.h>
22#include <xrpld/ledger/View.h>
24#include <xrpl/protocol/Indexes.h>
32 , key_(view_->succ(root_, next_quality_).value_or(
beast::zero))
35 root_ != beast::zero,
"ripple::BookDirs::BookDirs : nonzero root");
36 if (
key_ != beast::zero)
40 UNREACHABLE(
"ripple::BookDirs::BookDirs : directory is empty");
49 if (
key_ != beast::zero)
72 if (
view_ ==
nullptr || other.
view_ ==
nullptr)
77 "ripple::BookDirs::const_iterator::operator== : views and roots are "
88 "ripple::BookDirs::const_iterator::operator* : nonzero index");
101 "ripple::BookDirs::const_iterator::operator++ : nonzero index");
115 "ripple::BookDirs::const_iterator::operator++ : directory is "
120 cache_ = std::nullopt;
129 "ripple::BookDirs::const_iterator::operator++(int) : nonzero index");
A generic endpoint for log messages.
static Sink & getNullSink()
Returns a Sink which does nothing.
uint256 const next_quality_
BookDirs(ReadView const &, Book const &)
std::shared_ptr< SLE const > sle_
const_iterator begin() const
const_iterator end() const
bool operator==(const_iterator const &other) const
reference operator*() const
value_type const & reference
const_iterator & operator++()
virtual std::shared_ptr< SLE const > read(Keylet const &k) const =0
Return the state item associated with a key.
virtual std::optional< key_type > succ(key_type const &key, std::optional< key_type > const &last=std::nullopt) const =0
Return the key of the next state item.
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.
bool cdirFirst(ReadView const &view, uint256 const &root, std::shared_ptr< SLE const > &page, unsigned int &index, uint256 &entry)
Returns the first entry in the directory, advancing the index.
bool cdirNext(ReadView const &view, uint256 const &root, std::shared_ptr< SLE const > &page, unsigned int &index, uint256 &entry)
Returns the next entry in the directory, advancing the index.
uint256 getQualityNext(uint256 const &uBase)
uint256 getBookBase(Book const &book)