xrpld
Loading...
Searching...
No Matches
libxrpl
ledger
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
18
namespace
xrpl
{
19
20
ApplyViewImpl::ApplyViewImpl
(
ReadView
const
* base,
ApplyFlags
flags
) :
ApplyViewBase
(base,
flags
)
21
{
22
}
23
24
std::optional<TxMeta>
25
ApplyViewImpl::apply
(
26
OpenView
& to,
27
STTx
const
& tx,
28
TER
ter,
29
std::optional<uint256>
parentBatchId,
30
bool
isDryRun,
31
beast::Journal
j)
32
{
33
return
items_
.apply(to, tx, ter,
deliver_
, parentBatchId, isDryRun, j);
34
}
35
36
std::size_t
37
ApplyViewImpl::size
()
38
{
39
return
items_
.size();
40
}
41
42
void
43
ApplyViewImpl::visit
(
44
OpenView
& to,
45
std::function
<
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
beast::Journal
A generic endpoint for log messages.
Definition
Journal.h:38
xrpl::ApplyViewImpl::ApplyViewImpl
ApplyViewImpl()=delete
xrpl::ApplyViewImpl::apply
std::optional< TxMeta > apply(OpenView &to, STTx const &tx, TER ter, std::optional< uint256 > parentBatchId, bool isDryRun, beast::Journal j)
Apply the transaction.
Definition
ApplyViewImpl.cpp:25
xrpl::ApplyViewImpl::size
std::size_t size()
Get the number of modified entries.
Definition
ApplyViewImpl.cpp:37
xrpl::ApplyViewImpl::deliver_
std::optional< STAmount > deliver_
Definition
ApplyViewImpl.h:74
xrpl::ApplyViewImpl::visit
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.
Definition
ApplyViewImpl.cpp:43
xrpl::OpenView
Writable ledger view that accumulates state and tx changes.
Definition
OpenView.h:45
xrpl::ReadView
A view into a ledger.
Definition
ReadView.h:31
xrpl::STLedgerEntry::const_ref
std::shared_ptr< STLedgerEntry const > const & const_ref
Definition
STLedgerEntry.h:22
xrpl::STTx
Definition
STTx.h:28
xrpl::detail::ApplyViewBase::flags
ApplyFlags flags() const override
Returns the tx apply flags.
Definition
ApplyViewBase.cpp:112
xrpl::detail::ApplyViewBase::ApplyViewBase
ApplyViewBase()=delete
xrpl::detail::ApplyViewBase::items_
detail::ApplyStateTable items_
Definition
ApplyViewBase.h:101
cstddef
std::function
functional
xrpl
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition
algorithm.h:5
xrpl::after
bool after(NetClock::time_point now, std::uint32_t mark)
Has the specified time passed?
Definition
View.cpp:554
xrpl::ApplyFlags
ApplyFlags
Definition
ApplyView.h:12
xrpl::TER
TERSubset< CanCvtToTER > TER
Definition
TER.h:634
xrpl::uint256
BaseUInt< 256 > uint256
Definition
base_uint.h:562
optional
std::size_t
Generated by
1.16.1