xrpld
Loading...
Searching...
No Matches
ApplyViewImpl.cpp
1#include <xrpl/ledger/ApplyViewImpl.h>
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/STLedgerEntry.h>
10#include <xrpl/protocol/STTx.h>
11#include <xrpl/protocol/TER.h>
12#include <xrpl/protocol/TxMeta.h>
13
14#include <cstddef>
15#include <functional>
16#include <optional>
17
18namespace xrpl {
19
23
26 OpenView& to,
27 STTx const& tx,
28 TER ter,
29 std::optional<uint256> parentBatchId,
30 bool isDryRun,
32{
33 return items_.apply(to, tx, ter, deliver_, parentBatchId, isDryRun, j);
34}
35
38{
39 return items_.size();
40}
41
42void
44 OpenView& to,
46 void(uint256 const& key, bool isDelete, SLE::const_ref before, SLE::const_ref after)> const&
47 func)
48{
49 items_.visit(to, func);
50}
51
52} // namespace xrpl
A generic endpoint for log messages.
Definition Journal.h:38
std::optional< TxMeta > apply(OpenView &to, STTx const &tx, TER ter, std::optional< uint256 > parentBatchId, bool isDryRun, beast::Journal j)
Apply the transaction.
std::size_t size()
Get the number of modified entries.
std::optional< STAmount > deliver_
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:45
A view into a ledger.
Definition ReadView.h:31
std::shared_ptr< STLedgerEntry const > const & const_ref
ApplyFlags flags() const override
Returns the tx apply flags.
detail::ApplyStateTable items_
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:554
ApplyFlags
Definition ApplyView.h:12
TERSubset< CanCvtToTER > TER
Definition TER.h:634
BaseUInt< 256 > uint256
Definition base_uint.h:562