3#include <xrpl/beast/utility/instrumentation.h>
4#include <xrpl/ledger/ApplyView.h>
5#include <xrpl/ledger/ReadView.h>
6#include <xrpl/protocol/Indexes.h>
7#include <xrpl/protocol/STLedgerEntry.h>
8#include <xrpl/protocol/TER.h>
31 auto const& svIndexes = page->getFieldV256(sfIndexes);
32 XRPL_ASSERT(index <= svIndexes.size(),
"xrpl::detail::internalDirNext : index inside range");
34 if (index >= svIndexes.size())
36 auto const next = page->getFieldU64(sfIndexNext);
53 XRPL_ASSERT(page,
"xrpl::detail::internalDirNext : non-null root");
63 entry = svIndexes[index++];
116 ReadView
const& view,
148 ReadView
const& view,
166 ReadView
const& view,
178 ReadView
const& view,
217dirIsEmpty(ReadView
const& view, Keylet
const& k);
std::shared_ptr< STLedgerEntry > const & ref
bool internalDirFirst(V &view, uint256 const &root, std::shared_ptr< N > &page, unsigned int &index, uint256 &entry)
bool internalDirNext(V &view, uint256 const &root, std::shared_ptr< N > &page, unsigned int &index, uint256 &entry)
Keylet ownerDir(AccountID const &id) noexcept
The root page of an account's directory.
Keylet page(uint256 const &root, std::uint64_t index=0) noexcept
A page in a directory.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
bool dirFirst(ApplyView &view, uint256 const &root, std::shared_ptr< SLE > &page, unsigned int &index, uint256 &entry)
bool dirIsEmpty(ReadView const &view, Keylet const &k)
Returns true if the directory is empty.
void forEachItem(ReadView const &view, Keylet const &root, std::function< void(std::shared_ptr< SLE const > const &)> const &f)
Iterate all items in the given directory.
Number root(Number f, unsigned d)
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.
base_uint< 160, detail::AccountIDTag > AccountID
A 160-bit unsigned that uniquely identifies an account.
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 after(NetClock::time_point now, std::uint32_t mark)
Has the specified time passed?
std::function< void(SLE::ref)> describeOwnerDir(AccountID const &account)
Returns a function that sets the owner on a directory SLE.
bool forEachItemAfter(ReadView const &view, Keylet const &root, uint256 const &after, std::uint64_t const hint, unsigned int limit, std::function< bool(std::shared_ptr< SLE const > const &)> const &f)
Iterate all items after an item in the given directory.
bool dirNext(ApplyView &view, uint256 const &root, std::shared_ptr< SLE > &page, unsigned int &index, uint256 &entry)