xrpld
Loading...
Searching...
No Matches
xrpl::detail::ApplyStateTable Class Reference

#include <ApplyStateTable.h>

Collaboration diagram for xrpl::detail::ApplyStateTable:

Public Types

using key_type = ReadView::key_type

Public Member Functions

 ApplyStateTable ()=default
 ApplyStateTable (ApplyStateTable &&)=default
 ApplyStateTable (ApplyStateTable const &)=delete
ApplyStateTableoperator= (ApplyStateTable &&)=delete
ApplyStateTableoperator= (ApplyStateTable const &)=delete
void apply (RawView &to) const
std::optional< TxMetaapply (OpenView &to, STTx const &tx, TER ter, std::optional< STAmount > const &deliver, std::optional< uint256 const > const &parentBatchId, bool isDryRun, beast::Journal j)
bool exists (ReadView const &base, Keylet const &k) const
std::optional< key_typesucc (ReadView const &base, key_type const &key, std::optional< key_type > const &last) const
SLE::const_pointer read (ReadView const &base, Keylet const &k) const
SLE::pointer peek (ReadView const &base, Keylet const &k)
std::size_t size () const
void visit (ReadView const &base, std::function< void(uint256 const &key, bool isDelete, SLE::const_ref before, SLE::const_ref after)> const &func) const
void erase (ReadView const &base, SLE::ref sle)
void rawErase (ReadView const &base, SLE::ref sle)
void insert (ReadView const &base, SLE::ref sle)
void update (ReadView const &base, SLE::ref sle)
void replace (ReadView const &base, SLE::ref sle)
void destroyXRP (XRPAmount const &fee)
XRPAmount const & dropsDestroyed () const

Private Types

enum class  Action { Cache , Erase , Insert , Modify }
using items_t = std::map<key_type, std::pair<Action, SLE::pointer>>
using Mods = hash_map<key_type, SLE::pointer>

Private Member Functions

SLE::pointer getForMod (ReadView const &base, key_type const &key, Mods &mods, beast::Journal j)
void threadTx (ReadView const &base, TxMeta &meta, AccountID const &to, Mods &mods, beast::Journal j)
void threadOwners (ReadView const &base, TxMeta &meta, SLE::const_ref sle, Mods &mods, beast::Journal j)

Static Private Member Functions

static void threadItem (TxMeta &meta, SLE::ref to)

Private Attributes

items_t items_
XRPAmount dropsDestroyed_ {0}

Detailed Description

Definition at line 14 of file ApplyStateTable.h.

Member Typedef Documentation

◆ key_type

◆ items_t

◆ Mods

Member Enumeration Documentation

◆ Action

enum class xrpl::detail::ApplyStateTable::Action
strongprivate
Enumerator
Cache 
Erase 
Insert 
Modify 

Definition at line 20 of file ApplyStateTable.h.

Constructor & Destructor Documentation

◆ ApplyStateTable() [1/3]

xrpl::detail::ApplyStateTable::ApplyStateTable ( )
default

◆ ApplyStateTable() [2/3]

xrpl::detail::ApplyStateTable::ApplyStateTable ( ApplyStateTable && )
default

◆ ApplyStateTable() [3/3]

xrpl::detail::ApplyStateTable::ApplyStateTable ( ApplyStateTable const & )
delete

Member Function Documentation

◆ operator=() [1/2]

ApplyStateTable & xrpl::detail::ApplyStateTable::operator= ( ApplyStateTable && )
delete

◆ operator=() [2/2]

ApplyStateTable & xrpl::detail::ApplyStateTable::operator= ( ApplyStateTable const & )
delete

◆ apply() [1/2]

void xrpl::detail::ApplyStateTable::apply ( RawView & to) const

Definition at line 38 of file ApplyStateTable.cpp.

◆ apply() [2/2]

std::optional< TxMeta > xrpl::detail::ApplyStateTable::apply ( OpenView & to,
STTx const & tx,
TER ter,
std::optional< STAmount > const & deliver,
std::optional< uint256 const > const & parentBatchId,
bool isDryRun,
beast::Journal j )

Definition at line 110 of file ApplyStateTable.cpp.

◆ exists()

bool xrpl::detail::ApplyStateTable::exists ( ReadView const & base,
Keylet const & k ) const
nodiscard

Definition at line 286 of file ApplyStateTable.cpp.

◆ succ()

auto xrpl::detail::ApplyStateTable::succ ( ReadView const & base,
key_type const & key,
std::optional< key_type > const & last ) const
nodiscard

Definition at line 306 of file ApplyStateTable.cpp.

◆ read()

SLE::const_pointer xrpl::detail::ApplyStateTable::read ( ReadView const & base,
Keylet const & k ) const
nodiscard

Definition at line 341 of file ApplyStateTable.cpp.

◆ peek()

SLE::pointer xrpl::detail::ApplyStateTable::peek ( ReadView const & base,
Keylet const & k )

Definition at line 363 of file ApplyStateTable.cpp.

◆ size()

std::size_t xrpl::detail::ApplyStateTable::size ( ) const
nodiscard

Definition at line 62 of file ApplyStateTable.cpp.

◆ visit()

void xrpl::detail::ApplyStateTable::visit ( ReadView const & base,
std::function< void(uint256 const &key, bool isDelete, SLE::const_ref before, SLE::const_ref after)> const & func ) const

Definition at line 81 of file ApplyStateTable.cpp.

◆ erase()

void xrpl::detail::ApplyStateTable::erase ( ReadView const & base,
SLE::ref sle )

Definition at line 397 of file ApplyStateTable.cpp.

◆ rawErase()

void xrpl::detail::ApplyStateTable::rawErase ( ReadView const & base,
SLE::ref sle )

Definition at line 421 of file ApplyStateTable.cpp.

◆ insert()

void xrpl::detail::ApplyStateTable::insert ( ReadView const & base,
SLE::ref sle )

Definition at line 446 of file ApplyStateTable.cpp.

◆ update()

void xrpl::detail::ApplyStateTable::update ( ReadView const & base,
SLE::ref sle )

Definition at line 505 of file ApplyStateTable.cpp.

◆ replace()

void xrpl::detail::ApplyStateTable::replace ( ReadView const & base,
SLE::ref sle )

Definition at line 476 of file ApplyStateTable.cpp.

◆ destroyXRP()

void xrpl::detail::ApplyStateTable::destroyXRP ( XRPAmount const & fee)

Definition at line 528 of file ApplyStateTable.cpp.

◆ dropsDestroyed()

XRPAmount const & xrpl::detail::ApplyStateTable::dropsDestroyed ( ) const
nodiscard

Definition at line 99 of file ApplyStateTable.h.

◆ threadItem()

void xrpl::detail::ApplyStateTable::threadItem ( TxMeta & meta,
SLE::ref to )
staticprivate

Definition at line 537 of file ApplyStateTable.cpp.

◆ getForMod()

SLE::pointer xrpl::detail::ApplyStateTable::getForMod ( ReadView const & base,
key_type const & key,
Mods & mods,
beast::Journal j )
private

Definition at line 570 of file ApplyStateTable.cpp.

◆ threadTx()

void xrpl::detail::ApplyStateTable::threadTx ( ReadView const & base,
TxMeta & meta,
AccountID const & to,
Mods & mods,
beast::Journal j )
private

Definition at line 615 of file ApplyStateTable.cpp.

◆ threadOwners()

void xrpl::detail::ApplyStateTable::threadOwners ( ReadView const & base,
TxMeta & meta,
SLE::const_ref sle,
Mods & mods,
beast::Journal j )
private

Definition at line 638 of file ApplyStateTable.cpp.

Member Data Documentation

◆ items_

items_t xrpl::detail::ApplyStateTable::items_
private

Definition at line 29 of file ApplyStateTable.h.

◆ dropsDestroyed_

XRPAmount xrpl::detail::ApplyStateTable::dropsDestroyed_ {0}
private

Definition at line 30 of file ApplyStateTable.h.