rippled
Loading...
Searching...
No Matches
ApplyViewImpl.cpp
1//------------------------------------------------------------------------------
2/*
3 This file is part of rippled: https://github.com/ripple/rippled
4 Copyright (c) 2012, 2013 Ripple Labs Inc.
5
6 Permission to use, copy, modify, and/or distribute this software for any
7 purpose with or without fee is hereby granted, provided that the above
8 copyright notice and this permission notice appear in all copies.
9
10 THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
11 WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
12 MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
13 ANY SPECIAL , DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
14 WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
15 ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
16 OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
17*/
18//==============================================================================
19
20#include <xrpld/ledger/ApplyViewImpl.h>
21
22namespace ripple {
23
25 : ApplyViewBase(base, flags)
26{
27}
28
31 OpenView& to,
32 STTx const& tx,
33 TER ter,
34 std::optional<uint256> parentBatchId,
35 bool isDryRun,
37{
38 return items_.apply(to, tx, ter, deliver_, parentBatchId, isDryRun, j);
39}
40
43{
44 return items_.size();
45}
46
47void
49 OpenView& to,
50 std::function<void(
51 uint256 const& key,
52 bool isDelete,
53 std::shared_ptr<SLE const> const& before,
54 std::shared_ptr<SLE const> const& after)> const& func)
55{
56 items_.visit(to, func);
57}
58
59} // namespace ripple
A generic endpoint for log messages.
Definition: Journal.h:60
std::optional< TxMeta > apply(OpenView &to, STTx const &tx, TER ter, std::optional< uint256 > parentBatchId, bool isDryRun, beast::Journal j)
Apply the transaction.
std::optional< STAmount > deliver_
Definition: ApplyViewImpl.h:95
std::size_t size()
Get the number of modified entries.
void visit(OpenView &target, std::function< void(uint256 const &key, bool isDelete, std::shared_ptr< SLE const > const &before, std::shared_ptr< SLE const > const &after)> const &func)
Visit modified entries.
Writable ledger view that accumulates state and tx changes.
Definition: OpenView.h:66
A view into a ledger.
Definition: ReadView.h:52
void visit(ReadView const &base, std::function< void(uint256 const &key, bool isDelete, std::shared_ptr< SLE const > const &before, std::shared_ptr< SLE const > const &after)> const &func) const
void apply(RawView &to) const
detail::ApplyStateTable items_
Match set account flags.
Definition: flags.h:125
Set the expected result code for a JTx The test will fail if the code doesn't match.
Definition: ter.h:35
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition: algorithm.h:26
bool after(NetClock::time_point now, std::uint32_t mark)
Has the specified time passed?
Definition: View.cpp:2696
ApplyFlags
Definition: ApplyView.h:31