xrpld
Loading...
Searching...
No Matches
xrpl::ledger_entries::DirectoryNode Class Reference

Ledger Entry: DirectoryNode. More...

#include <DirectoryNode.h>

Inheritance diagram for xrpl::ledger_entries::DirectoryNode:
Collaboration diagram for xrpl::ledger_entries::DirectoryNode:

Public Member Functions

 DirectoryNode (SLE::const_pointer sle)
 Construct a DirectoryNode ledger entry wrapper from an existing SLE object.
protocol_autogen::Optional< SF_ACCOUNT::type::value_type > getOwner () const
 Get sfOwner (SoeOptional).
bool hasOwner () const
 Check if sfOwner is present.
protocol_autogen::Optional< SF_UINT160::type::value_type > getTakerPaysCurrency () const
 Get sfTakerPaysCurrency (SoeOptional).
bool hasTakerPaysCurrency () const
 Check if sfTakerPaysCurrency is present.
protocol_autogen::Optional< SF_UINT160::type::value_type > getTakerPaysIssuer () const
 Get sfTakerPaysIssuer (SoeOptional).
bool hasTakerPaysIssuer () const
 Check if sfTakerPaysIssuer is present.
protocol_autogen::Optional< SF_UINT192::type::value_type > getTakerPaysMPT () const
 Get sfTakerPaysMPT (SoeOptional).
bool hasTakerPaysMPT () const
 Check if sfTakerPaysMPT is present.
protocol_autogen::Optional< SF_UINT160::type::value_type > getTakerGetsCurrency () const
 Get sfTakerGetsCurrency (SoeOptional).
bool hasTakerGetsCurrency () const
 Check if sfTakerGetsCurrency is present.
protocol_autogen::Optional< SF_UINT160::type::value_type > getTakerGetsIssuer () const
 Get sfTakerGetsIssuer (SoeOptional).
bool hasTakerGetsIssuer () const
 Check if sfTakerGetsIssuer is present.
protocol_autogen::Optional< SF_UINT192::type::value_type > getTakerGetsMPT () const
 Get sfTakerGetsMPT (SoeOptional).
bool hasTakerGetsMPT () const
 Check if sfTakerGetsMPT is present.
protocol_autogen::Optional< SF_UINT64::type::value_type > getExchangeRate () const
 Get sfExchangeRate (SoeOptional).
bool hasExchangeRate () const
 Check if sfExchangeRate is present.
SF_VECTOR256::type::value_type getIndexes () const
 Get sfIndexes (SoeRequired).
SF_UINT256::type::value_type getRootIndex () const
 Get sfRootIndex (SoeRequired).
protocol_autogen::Optional< SF_UINT64::type::value_type > getIndexNext () const
 Get sfIndexNext (SoeOptional).
bool hasIndexNext () const
 Check if sfIndexNext is present.
protocol_autogen::Optional< SF_UINT64::type::value_type > getIndexPrevious () const
 Get sfIndexPrevious (SoeOptional).
bool hasIndexPrevious () const
 Check if sfIndexPrevious is present.
protocol_autogen::Optional< SF_UINT256::type::value_type > getNFTokenID () const
 Get sfNFTokenID (SoeOptional).
bool hasNFTokenID () const
 Check if sfNFTokenID is present.
protocol_autogen::Optional< SF_UINT256::type::value_type > getPreviousTxnID () const
 Get sfPreviousTxnID (SoeOptional).
bool hasPreviousTxnID () const
 Check if sfPreviousTxnID is present.
protocol_autogen::Optional< SF_UINT32::type::value_type > getPreviousTxnLgrSeq () const
 Get sfPreviousTxnLgrSeq (SoeOptional).
bool hasPreviousTxnLgrSeq () const
 Check if sfPreviousTxnLgrSeq is present.
protocol_autogen::Optional< SF_UINT256::type::value_type > getDomainID () const
 Get sfDomainID (SoeOptional).
bool hasDomainID () const
 Check if sfDomainID is present.
bool validate () const
 Validate the ledger entry.
LedgerEntryType getType () const
 Get the ledger entry type.
uint256 const & getKey () const
 Get the key (index) of this ledger entry.
std::optional< uint256getLedgerIndex () const
 Get the ledger index (sfLedgerIndex).
bool hasLedgerIndex () const
 Check if the ledger entry has a ledger index.
uint16_t getLedgerEntryType () const
 Get the ledger entry type field (sfLedgerEntryType).
std::uint32_t getFlags () const
 Get the flags field (sfFlags).
bool isFlag (std::uint32_t f) const
 Check if a specific flag is set.
SLE::const_pointer getSle () const
 Get the underlying SLE object.

Static Public Attributes

static constexpr LedgerEntryType entryType = ltDIR_NODE

Protected Attributes

SLE::const_pointer sle_
 The underlying serialized ledger entry being wrapped.

Detailed Description

Ledger Entry: DirectoryNode.

Type: ltDIR_NODE (0x0064) RPC Name: directory

Immutable wrapper around SLE providing type-safe field access. Use DirectoryNodeBuilder to construct new ledger entries.

Definition at line 27 of file DirectoryNode.h.

Constructor & Destructor Documentation

◆ DirectoryNode()

xrpl::ledger_entries::DirectoryNode::DirectoryNode ( SLE::const_pointer sle)
explicit

Construct a DirectoryNode ledger entry wrapper from an existing SLE object.

Exceptions
std::runtime_errorif the ledger entry type doesn't match.

Definition at line 36 of file DirectoryNode.h.

Member Function Documentation

◆ getOwner()

protocol_autogen::Optional< SF_ACCOUNT::type::value_type > xrpl::ledger_entries::DirectoryNode::getOwner ( ) const
nodiscard

Get sfOwner (SoeOptional).

Returns
The field value, or std::nullopt if not present.

Definition at line 54 of file DirectoryNode.h.

◆ hasOwner()

bool xrpl::ledger_entries::DirectoryNode::hasOwner ( ) const
nodiscard

Check if sfOwner is present.

Returns
True if the field is present, false otherwise.

Definition at line 67 of file DirectoryNode.h.

◆ getTakerPaysCurrency()

protocol_autogen::Optional< SF_UINT160::type::value_type > xrpl::ledger_entries::DirectoryNode::getTakerPaysCurrency ( ) const
nodiscard

Get sfTakerPaysCurrency (SoeOptional).

Returns
The field value, or std::nullopt if not present.

Definition at line 78 of file DirectoryNode.h.

◆ hasTakerPaysCurrency()

bool xrpl::ledger_entries::DirectoryNode::hasTakerPaysCurrency ( ) const
nodiscard

Check if sfTakerPaysCurrency is present.

Returns
True if the field is present, false otherwise.

Definition at line 91 of file DirectoryNode.h.

◆ getTakerPaysIssuer()

protocol_autogen::Optional< SF_UINT160::type::value_type > xrpl::ledger_entries::DirectoryNode::getTakerPaysIssuer ( ) const
nodiscard

Get sfTakerPaysIssuer (SoeOptional).

Returns
The field value, or std::nullopt if not present.

Definition at line 102 of file DirectoryNode.h.

◆ hasTakerPaysIssuer()

bool xrpl::ledger_entries::DirectoryNode::hasTakerPaysIssuer ( ) const
nodiscard

Check if sfTakerPaysIssuer is present.

Returns
True if the field is present, false otherwise.

Definition at line 115 of file DirectoryNode.h.

◆ getTakerPaysMPT()

protocol_autogen::Optional< SF_UINT192::type::value_type > xrpl::ledger_entries::DirectoryNode::getTakerPaysMPT ( ) const
nodiscard

Get sfTakerPaysMPT (SoeOptional).

Returns
The field value, or std::nullopt if not present.

Definition at line 126 of file DirectoryNode.h.

◆ hasTakerPaysMPT()

bool xrpl::ledger_entries::DirectoryNode::hasTakerPaysMPT ( ) const
nodiscard

Check if sfTakerPaysMPT is present.

Returns
True if the field is present, false otherwise.

Definition at line 139 of file DirectoryNode.h.

◆ getTakerGetsCurrency()

protocol_autogen::Optional< SF_UINT160::type::value_type > xrpl::ledger_entries::DirectoryNode::getTakerGetsCurrency ( ) const
nodiscard

Get sfTakerGetsCurrency (SoeOptional).

Returns
The field value, or std::nullopt if not present.

Definition at line 150 of file DirectoryNode.h.

◆ hasTakerGetsCurrency()

bool xrpl::ledger_entries::DirectoryNode::hasTakerGetsCurrency ( ) const
nodiscard

Check if sfTakerGetsCurrency is present.

Returns
True if the field is present, false otherwise.

Definition at line 163 of file DirectoryNode.h.

◆ getTakerGetsIssuer()

protocol_autogen::Optional< SF_UINT160::type::value_type > xrpl::ledger_entries::DirectoryNode::getTakerGetsIssuer ( ) const
nodiscard

Get sfTakerGetsIssuer (SoeOptional).

Returns
The field value, or std::nullopt if not present.

Definition at line 174 of file DirectoryNode.h.

◆ hasTakerGetsIssuer()

bool xrpl::ledger_entries::DirectoryNode::hasTakerGetsIssuer ( ) const
nodiscard

Check if sfTakerGetsIssuer is present.

Returns
True if the field is present, false otherwise.

Definition at line 187 of file DirectoryNode.h.

◆ getTakerGetsMPT()

protocol_autogen::Optional< SF_UINT192::type::value_type > xrpl::ledger_entries::DirectoryNode::getTakerGetsMPT ( ) const
nodiscard

Get sfTakerGetsMPT (SoeOptional).

Returns
The field value, or std::nullopt if not present.

Definition at line 198 of file DirectoryNode.h.

◆ hasTakerGetsMPT()

bool xrpl::ledger_entries::DirectoryNode::hasTakerGetsMPT ( ) const
nodiscard

Check if sfTakerGetsMPT is present.

Returns
True if the field is present, false otherwise.

Definition at line 211 of file DirectoryNode.h.

◆ getExchangeRate()

protocol_autogen::Optional< SF_UINT64::type::value_type > xrpl::ledger_entries::DirectoryNode::getExchangeRate ( ) const
nodiscard

Get sfExchangeRate (SoeOptional).

Returns
The field value, or std::nullopt if not present.

Definition at line 222 of file DirectoryNode.h.

◆ hasExchangeRate()

bool xrpl::ledger_entries::DirectoryNode::hasExchangeRate ( ) const
nodiscard

Check if sfExchangeRate is present.

Returns
True if the field is present, false otherwise.

Definition at line 235 of file DirectoryNode.h.

◆ getIndexes()

SF_VECTOR256::type::value_type xrpl::ledger_entries::DirectoryNode::getIndexes ( ) const
nodiscard

Get sfIndexes (SoeRequired).

Returns
The field value.

Definition at line 246 of file DirectoryNode.h.

◆ getRootIndex()

SF_UINT256::type::value_type xrpl::ledger_entries::DirectoryNode::getRootIndex ( ) const
nodiscard

Get sfRootIndex (SoeRequired).

Returns
The field value.

Definition at line 257 of file DirectoryNode.h.

◆ getIndexNext()

protocol_autogen::Optional< SF_UINT64::type::value_type > xrpl::ledger_entries::DirectoryNode::getIndexNext ( ) const
nodiscard

Get sfIndexNext (SoeOptional).

Returns
The field value, or std::nullopt if not present.

Definition at line 268 of file DirectoryNode.h.

◆ hasIndexNext()

bool xrpl::ledger_entries::DirectoryNode::hasIndexNext ( ) const
nodiscard

Check if sfIndexNext is present.

Returns
True if the field is present, false otherwise.

Definition at line 281 of file DirectoryNode.h.

◆ getIndexPrevious()

protocol_autogen::Optional< SF_UINT64::type::value_type > xrpl::ledger_entries::DirectoryNode::getIndexPrevious ( ) const
nodiscard

Get sfIndexPrevious (SoeOptional).

Returns
The field value, or std::nullopt if not present.

Definition at line 292 of file DirectoryNode.h.

◆ hasIndexPrevious()

bool xrpl::ledger_entries::DirectoryNode::hasIndexPrevious ( ) const
nodiscard

Check if sfIndexPrevious is present.

Returns
True if the field is present, false otherwise.

Definition at line 305 of file DirectoryNode.h.

◆ getNFTokenID()

protocol_autogen::Optional< SF_UINT256::type::value_type > xrpl::ledger_entries::DirectoryNode::getNFTokenID ( ) const
nodiscard

Get sfNFTokenID (SoeOptional).

Returns
The field value, or std::nullopt if not present.

Definition at line 316 of file DirectoryNode.h.

◆ hasNFTokenID()

bool xrpl::ledger_entries::DirectoryNode::hasNFTokenID ( ) const
nodiscard

Check if sfNFTokenID is present.

Returns
True if the field is present, false otherwise.

Definition at line 329 of file DirectoryNode.h.

◆ getPreviousTxnID()

protocol_autogen::Optional< SF_UINT256::type::value_type > xrpl::ledger_entries::DirectoryNode::getPreviousTxnID ( ) const
nodiscard

Get sfPreviousTxnID (SoeOptional).

Returns
The field value, or std::nullopt if not present.

Definition at line 340 of file DirectoryNode.h.

◆ hasPreviousTxnID()

bool xrpl::ledger_entries::DirectoryNode::hasPreviousTxnID ( ) const
nodiscard

Check if sfPreviousTxnID is present.

Returns
True if the field is present, false otherwise.

Definition at line 353 of file DirectoryNode.h.

◆ getPreviousTxnLgrSeq()

protocol_autogen::Optional< SF_UINT32::type::value_type > xrpl::ledger_entries::DirectoryNode::getPreviousTxnLgrSeq ( ) const
nodiscard

Get sfPreviousTxnLgrSeq (SoeOptional).

Returns
The field value, or std::nullopt if not present.

Definition at line 364 of file DirectoryNode.h.

◆ hasPreviousTxnLgrSeq()

bool xrpl::ledger_entries::DirectoryNode::hasPreviousTxnLgrSeq ( ) const
nodiscard

Check if sfPreviousTxnLgrSeq is present.

Returns
True if the field is present, false otherwise.

Definition at line 377 of file DirectoryNode.h.

◆ getDomainID()

protocol_autogen::Optional< SF_UINT256::type::value_type > xrpl::ledger_entries::DirectoryNode::getDomainID ( ) const
nodiscard

Get sfDomainID (SoeOptional).

Returns
The field value, or std::nullopt if not present.

Definition at line 388 of file DirectoryNode.h.

◆ hasDomainID()

bool xrpl::ledger_entries::DirectoryNode::hasDomainID ( ) const
nodiscard

Check if sfDomainID is present.

Returns
True if the field is present, false otherwise.

Definition at line 401 of file DirectoryNode.h.

◆ validate()

bool xrpl::ledger_entries::LedgerEntryBase::validate ( ) const
nodiscardinherited

Validate the ledger entry.

Returns
true if validation passes, false otherwise

Definition at line 40 of file LedgerEntryBase.h.

◆ getType()

LedgerEntryType xrpl::ledger_entries::LedgerEntryBase::getType ( ) const
nodiscardinherited

Get the ledger entry type.

Returns
The type of this ledger entry

Definition at line 57 of file LedgerEntryBase.h.

◆ getKey()

uint256 const & xrpl::ledger_entries::LedgerEntryBase::getKey ( ) const
nodiscardinherited

Get the key (index) of this ledger entry.

The key uniquely identifies this ledger entry in the ledger state.

Returns
A constant reference to the 256-bit key

Definition at line 70 of file LedgerEntryBase.h.

◆ getLedgerIndex()

std::optional< uint256 > xrpl::ledger_entries::LedgerEntryBase::getLedgerIndex ( ) const
nodiscardinherited

Get the ledger index (sfLedgerIndex).

This field is OPTIONAL and represents the index of the ledger entry.

Returns
The ledger index if present, std::nullopt otherwise

Definition at line 85 of file LedgerEntryBase.h.

◆ hasLedgerIndex()

bool xrpl::ledger_entries::LedgerEntryBase::hasLedgerIndex ( ) const
nodiscardinherited

Check if the ledger entry has a ledger index.

Returns
true if sfLedgerIndex is present, false otherwise

Definition at line 100 of file LedgerEntryBase.h.

◆ getLedgerEntryType()

uint16_t xrpl::ledger_entries::LedgerEntryBase::getLedgerEntryType ( ) const
nodiscardinherited

Get the ledger entry type field (sfLedgerEntryType).

This field is REQUIRED for all ledger entries and indicates the type of the ledger entry (e.g., AccountRoot, RippleState, Offer, etc.).

Returns
The ledger entry type as a 16-bit unsigned integer

Definition at line 114 of file LedgerEntryBase.h.

◆ getFlags()

std::uint32_t xrpl::ledger_entries::LedgerEntryBase::getFlags ( ) const
nodiscardinherited

Get the flags field (sfFlags).

This field is REQUIRED for all ledger entries and contains type-specific flags that modify the behavior of the ledger entry.

Returns
The flags value as a 32-bit unsigned integer

Definition at line 128 of file LedgerEntryBase.h.

◆ isFlag()

bool xrpl::ledger_entries::LedgerEntryBase::isFlag ( std::uint32_t f) const
nodiscardinherited

Check if a specific flag is set.

Parameters
fThe flag bitmask to check
Returns
true if all bits in f are set in the flags field

Definition at line 141 of file LedgerEntryBase.h.

◆ getSle()

SLE::const_pointer xrpl::ledger_entries::LedgerEntryBase::getSle ( ) const
nodiscardinherited

Get the underlying SLE object.

Provides direct access to the wrapped serialized ledger entry object for cases where the type-safe accessors are insufficient.

Returns
A constant reference to the underlying SLE object

Definition at line 155 of file LedgerEntryBase.h.

Member Data Documentation

◆ entryType

LedgerEntryType xrpl::ledger_entries::DirectoryNode::entryType = ltDIR_NODE
staticconstexpr

Definition at line 30 of file DirectoryNode.h.

◆ sle_

SLE::const_pointer xrpl::ledger_entries::LedgerEntryBase::sle_
protectedinherited

The underlying serialized ledger entry being wrapped.

Definition at line 162 of file LedgerEntryBase.h.