xrpld
Loading...
Searching...
No Matches
ApplyViewImpl.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/OpenView.h>
7#include <xrpl/ledger/ReadView.h>
8#include <xrpl/ledger/detail/ApplyViewBase.h>
9#include <xrpl/protocol/STAmount.h>
10#include <xrpl/protocol/STLedgerEntry.h>
11#include <xrpl/protocol/STTx.h>
12#include <xrpl/protocol/TER.h>
13#include <xrpl/protocol/TxMeta.h>
14
15#include <cstddef>
16#include <functional>
17#include <optional>
18
19namespace xrpl {
20
29{
30public:
31 ApplyViewImpl() = delete;
32 ApplyViewImpl(ApplyViewImpl const&) = delete;
36 operator=(ApplyViewImpl const&) = delete;
37
40
49 apply(
50 OpenView& to,
51 STTx const& tx,
52 TER ter,
53 std::optional<uint256> parentBatchId,
54 bool isDryRun,
56
65 void
66 deliver(STAmount const& amount)
67 {
68 deliver_ = amount;
69 }
70
75 size();
76
80 void
81 visit(
82 OpenView& target,
83 std::function<void(
84 uint256 const& key,
85 bool isDelete,
86 SLE::const_ref before,
87 SLE::const_ref after)> const& func);
88
89private:
91};
92
93} // namespace xrpl
A generic endpoint for log messages.
Definition Journal.h:44
ApplyViewImpl(ApplyViewImpl const &)=delete
ApplyViewImpl & operator=(ApplyViewImpl const &)=delete
std::optional< TxMeta > apply(OpenView &to, STTx const &tx, TER ter, std::optional< uint256 > parentBatchId, bool isDryRun, beast::Journal j)
Apply the transaction.
ApplyViewImpl & operator=(ApplyViewImpl &&)=delete
std::size_t size()
Get the number of modified entries.
std::optional< STAmount > deliver_
ApplyViewImpl(ApplyViewImpl &&)=default
void deliver(STAmount const &amount)
Set the amount of currency delivered.
void visit(OpenView &target, std::function< void(uint256 const &key, bool isDelete, SLE::const_ref before, SLE::const_ref after)> const &func)
Visit modified entries.
Writable ledger view that accumulates state and tx changes.
Definition OpenView.h:59
A view into a ledger.
Definition ReadView.h:41
std::shared_ptr< STLedgerEntry const > const & const_ref
ApplyFlags flags() const override
Returns the tx apply flags.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
bool after(NetClock::time_point now, std::uint32_t mark)
Has the specified time passed?
Definition View.cpp:572
ApplyFlags
Definition ApplyView.h:27
TERSubset< CanCvtToTER > TER
Definition TER.h:647
BaseUInt< 256 > uint256
Definition base_uint.h:580