rippled
Loading...
Searching...
No Matches
ApplyViewBase.h
1#ifndef XRPL_LEDGER_APPLYVIEWBASE_H_INCLUDED
2#define XRPL_LEDGER_APPLYVIEWBASE_H_INCLUDED
3
4#include <xrpl/ledger/ApplyView.h>
5#include <xrpl/ledger/ReadView.h>
6#include <xrpl/ledger/detail/ApplyStateTable.h>
7#include <xrpl/protocol/XRPAmount.h>
8
9namespace ripple {
10namespace detail {
11
12class ApplyViewBase : public ApplyView, public RawView
13{
14public:
15 ApplyViewBase() = delete;
16 ApplyViewBase(ApplyViewBase const&) = delete;
20 operator=(ApplyViewBase const&) = delete;
21
23
25
26 // ReadView
27 bool
28 open() const override;
29
30 LedgerInfo const&
31 info() const override;
32
33 Fees const&
34 fees() const override;
35
36 Rules const&
37 rules() const override;
38
39 bool
40 exists(Keylet const& k) const override;
41
43 succ(
44 key_type const& key,
45 std::optional<key_type> const& last = std::nullopt) const override;
46
48 read(Keylet const& k) const override;
49
51 slesBegin() const override;
52
54 slesEnd() const override;
55
57 slesUpperBound(uint256 const& key) const override;
58
60 txsBegin() const override;
61
63 txsEnd() const override;
64
65 bool
66 txExists(key_type const& key) const override;
67
69 txRead(key_type const& key) const override;
70
71 // ApplyView
72
74 flags() const override;
75
77 peek(Keylet const& k) override;
78
79 void
80 erase(std::shared_ptr<SLE> const& sle) override;
81
82 void
83 insert(std::shared_ptr<SLE> const& sle) override;
84
85 void
86 update(std::shared_ptr<SLE> const& sle) override;
87
88 // RawView
89
90 void
91 rawErase(std::shared_ptr<SLE> const& sle) override;
92
93 void
94 rawInsert(std::shared_ptr<SLE> const& sle) override;
95
96 void
97 rawReplace(std::shared_ptr<SLE> const& sle) override;
98
99 void
100 rawDestroyXRP(XRPAmount const& feeDrops) override;
101
102protected:
106};
107
108} // namespace detail
109} // namespace ripple
110
111#endif
Writeable view to a ledger, for applying a transaction.
Definition ApplyView.h:124
Interface for ledger entry changes.
Definition RawView.h:15
A view into a ledger.
Definition ReadView.h:32
Rules controlling protocol behavior.
Definition Rules.h:19
ApplyViewBase(ApplyViewBase &&)=default
Fees const & fees() const override
Returns the fees for the base ledger.
void erase(std::shared_ptr< SLE > const &sle) override
Remove a peeked SLE.
void rawDestroyXRP(XRPAmount const &feeDrops) override
Destroy XRP.
std::unique_ptr< txs_type::iter_base > txsEnd() const override
bool open() const override
Returns true if this reflects an open ledger.
void update(std::shared_ptr< SLE > const &sle) override
Indicate changes to a peeked SLE.
ApplyViewBase & operator=(ApplyViewBase &&)=delete
void insert(std::shared_ptr< SLE > const &sle) override
Insert a new state SLE.
std::unique_ptr< sles_type::iter_base > slesEnd() const override
LedgerInfo const & info() const override
Returns information about the ledger.
detail::ApplyStateTable items_
void rawReplace(std::shared_ptr< SLE > const &sle) override
Unconditionally replace a state item.
void rawErase(std::shared_ptr< SLE > const &sle) override
Delete an existing state item.
tx_type txRead(key_type const &key) const override
Read a transaction from the tx map.
ApplyViewBase(ApplyViewBase const &)=delete
std::unique_ptr< sles_type::iter_base > slesBegin() const override
std::unique_ptr< txs_type::iter_base > txsBegin() const override
void rawInsert(std::shared_ptr< SLE > const &sle) override
Unconditionally insert a state item.
ApplyViewBase & operator=(ApplyViewBase const &)=delete
bool exists(Keylet const &k) const override
Determine if a state item exists.
std::optional< key_type > succ(key_type const &key, std::optional< key_type > const &last=std::nullopt) const override
Return the key of the next state item.
ApplyFlags flags() const override
Returns the tx apply flags.
bool txExists(key_type const &key) const override
Returns true if a tx exists in the tx map.
std::shared_ptr< SLE const > read(Keylet const &k) const override
Return the state item associated with a key.
std::unique_ptr< sles_type::iter_base > slesUpperBound(uint256 const &key) const override
Rules const & rules() const override
Returns the tx processing rules.
std::shared_ptr< SLE > peek(Keylet const &k) override
Prepare to modify the SLE associated with key.
T is_same_v
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
Reflects the fee settings for a particular ledger.
A pair of SHAMap key and LedgerEntryType.
Definition Keylet.h:20
Information about the notional ledger backing the view.