xrpld
Loading...
Searching...
No Matches
xrpl::ApplyContext Class Reference

State information when applying a tx. More...

#include <ApplyContext.h>

Collaboration diagram for xrpl::ApplyContext:

Public Member Functions

 ApplyContext (ServiceRegistry &registry, OpenView &base, std::optional< UInt256 const > const &parentBatchId, STTx const &tx, TER preclaimResult, XRPAmount baseFee, ApplyFlags flags, beast::Journal journal=beast::Journal{beast::Journal::getNullSink()})
 ApplyContext (ServiceRegistry &registry, OpenView &base, STTx const &tx, TER preclaimResult, XRPAmount baseFee, ApplyFlags flags, beast::Journal journal=beast::Journal{beast::Journal::getNullSink()})
ApplyView & view ()
ApplyView const & view () const
RawView & rawView ()
ApplyFlags const & flags () const
void deliver (STAmount const &amount)
 Sets the DeliveredAmount field in the metadata.
void discard ()
 Discard changes and start fresh.
std::optional< TxMeta > apply (TER)
 Apply the transaction result to the base.
std::size_t size ()
 Get the number of unapplied changes.
void visit (std::function< void(UInt256 const &key, bool isDelete, SLE::ConstRef before, SLE::ConstRef after)> const &func)
 Visit unapplied changes.
void destroyXRP (XRPAmount const &fee)
void addOrderBook (Book const &book)
 Registers a newly-created order book directory with the shared, process-wide OrderBookDB, unless this transaction is being applied under TapDryRun.
ApplyViewContext getApplyViewContext ()

Public Attributes

std::reference_wrapper< ServiceRegistry > registry
STTx const & tx
TER const preclaimResult
XRPAmount const baseFee
beast::Journal const journal

Private Attributes

OpenView & base_
ApplyFlags flags_
std::optional< ApplyViewImpl > view_
std::optional< UInt256 const > parentBatchId_

Detailed Description

State information when applying a tx.

Definition at line 27 of file ApplyContext.h.

Constructor & Destructor Documentation

◆ ApplyContext() [1/2]

xrpl::ApplyContext::ApplyContext ( ServiceRegistry & registry,
OpenView & base,
std::optional< UInt256 const > const & parentBatchId,
STTx const & tx,
TER preclaimResult,
XRPAmount baseFee,
ApplyFlags flags,
beast::Journal journal = beast::Journal{beast::Journal::getNullSink()} )
explicit

Definition at line 22 of file ApplyContext.cpp.

◆ ApplyContext() [2/2]

xrpl::ApplyContext::ApplyContext ( ServiceRegistry & registry,
OpenView & base,
STTx const & tx,
TER preclaimResult,
XRPAmount baseFee,
ApplyFlags flags,
beast::Journal journal = beast::Journal{beast::Journal::getNullSink()} )
explicit

Definition at line 44 of file ApplyContext.h.

Member Function Documentation

◆ view() [1/2]

ApplyView & xrpl::ApplyContext::view ( )

Definition at line 64 of file ApplyContext.h.

◆ view() [2/2]

ApplyView const & xrpl::ApplyContext::view ( ) const
nodiscard

Definition at line 70 of file ApplyContext.h.

◆ rawView()

RawView & xrpl::ApplyContext::rawView ( )

Definition at line 77 of file ApplyContext.h.

◆ flags()

ApplyFlags const & xrpl::ApplyContext::flags ( ) const
nodiscard

Definition at line 83 of file ApplyContext.h.

◆ deliver()

void xrpl::ApplyContext::deliver ( STAmount const & amount)

Sets the DeliveredAmount field in the metadata.

Definition at line 92 of file ApplyContext.h.

◆ discard()

void xrpl::ApplyContext::discard ( )

Discard changes and start fresh.

Definition at line 47 of file ApplyContext.cpp.

◆ apply()

std::optional< TxMeta > xrpl::ApplyContext::apply ( TER ter)

Apply the transaction result to the base.

Definition at line 53 of file ApplyContext.cpp.

◆ size()

std::size_t xrpl::ApplyContext::size ( )

Get the number of unapplied changes.

Definition at line 67 of file ApplyContext.cpp.

◆ visit()

void xrpl::ApplyContext::visit ( std::function< void(UInt256 const &key, bool isDelete, SLE::ConstRef before, SLE::ConstRef after)> const & func)

Visit unapplied changes.

Definition at line 73 of file ApplyContext.cpp.

◆ destroyXRP()

void xrpl::ApplyContext::destroyXRP ( XRPAmount const & fee)

Definition at line 127 of file ApplyContext.h.

◆ addOrderBook()

void xrpl::ApplyContext::addOrderBook ( Book const & book)

Registers a newly-created order book directory with the shared, process-wide OrderBookDB, unless this transaction is being applied under TapDryRun.

Definition at line 60 of file ApplyContext.cpp.

◆ getApplyViewContext()

ApplyViewContext xrpl::ApplyContext::getApplyViewContext ( )

Definition at line 142 of file ApplyContext.h.

Member Data Documentation

◆ registry

std::reference_wrapper<ServiceRegistry> xrpl::ApplyContext::registry

Definition at line 57 of file ApplyContext.h.

◆ tx

STTx const& xrpl::ApplyContext::tx

Definition at line 58 of file ApplyContext.h.

◆ preclaimResult

TER const xrpl::ApplyContext::preclaimResult

Definition at line 59 of file ApplyContext.h.

◆ baseFee

XRPAmount const xrpl::ApplyContext::baseFee

Definition at line 60 of file ApplyContext.h.

◆ journal

beast::Journal const xrpl::ApplyContext::journal

Definition at line 61 of file ApplyContext.h.

◆ base_

OpenView& xrpl::ApplyContext::base_
private

Definition at line 151 of file ApplyContext.h.

◆ flags_

ApplyFlags xrpl::ApplyContext::flags_
private

Definition at line 152 of file ApplyContext.h.

◆ view_

std::optional<ApplyViewImpl> xrpl::ApplyContext::view_
private

Definition at line 153 of file ApplyContext.h.

◆ parentBatchId_

std::optional<UInt256 const> xrpl::ApplyContext::parentBatchId_
private

Definition at line 156 of file ApplyContext.h.