xrpld
Loading...
Searching...
No Matches
DirectoryNodeEntry.h
1#pragma once
2
3#include <xrpl/basics/base_uint.h>
4#include <xrpl/beast/utility/Journal.h>
5#include <xrpl/ledger/ApplyView.h>
6#include <xrpl/ledger/ReadView.h>
7#include <xrpl/ledger/entries/SLEBase.h>
8#include <xrpl/protocol/AccountID.h>
9#include <xrpl/protocol/Indexes.h>
10#include <xrpl/protocol/LedgerFormats.h>
11
12#include <cstdint>
13
14namespace xrpl {
15
16template <typename ViewT>
17class DirectoryNodeEntry : public SLEBase<ViewT, ltDIR_NODE>
18{
19public:
21
22 // Inherit base constructors: adopt an existing SLE, or resolve one from a
23 // Keylet against the view.
24 using Base::Base;
25
27 AccountID const& id,
30 : Base(keylet::ownerDir(id), view, j)
31 {
32 }
33
38 UInt256 const& root,
39 std::uint64_t index,
42 : Base(keylet::page(root, index), view, j)
43 {
44 }
45};
46
49
50} // namespace xrpl
A generic endpoint for log messages.
Definition Journal.h:44
static Sink & getNullSink()
Returns a Sink which does nothing.
SLEBase< ViewT, ltDIR_NODE > Base
DirectoryNodeEntry(UInt256 const &root, std::uint64_t index, Base::ViewRefType view, beast::Journal j=beast::Journal{beast::Journal::getNullSink()})
Resolve a specific page of the directory rooted at root.
DirectoryNodeEntry(AccountID const &id, Base::ViewRefType view, beast::Journal j=beast::Journal{beast::Journal::getNullSink()})
std::conditional_t< kIsWritable, ApplyView &, ReadView const & > ViewRefType
Definition SLEBase.h:106
SLEBase(SLEBase const &)=default
Keylet computation functions.
Definition Indexes.h:40
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
DirectoryNodeEntry< ReadView > DirectoryNodeEntryR
Number root(Number f, unsigned d)
BaseUInt< 256 > UInt256
Definition base_uint.h:580
DirectoryNodeEntry< ApplyView > DirectoryNodeEntryW
BaseUInt< 160, detail::AccountIDTag > AccountID
A 160-bit unsigned that uniquely identifies an account.
Definition AccountID.h:34