rippled
Loading...
Searching...
No Matches
ApplyViewBase.cpp
1#include <xrpl/ledger/detail/ApplyViewBase.h>
2
3namespace xrpl {
4namespace detail {
5
6ApplyViewBase::ApplyViewBase(ReadView const* base, ApplyFlags flags) : flags_(flags), base_(base)
7{
8}
9
10//---
11
12bool
14{
15 return base_->open();
16}
17
18LedgerHeader const&
20{
21 return base_->header();
22}
23
24Fees const&
26{
27 return base_->fees();
28}
29
30Rules const&
32{
33 return base_->rules();
34}
35
36bool
38{
39 return items_.exists(*base_, k);
40}
41
42auto
44{
45 return items_.succ(*base_, key, last);
46}
47
50{
51 return items_.read(*base_, k);
52}
53
54auto
55ApplyViewBase::slesBegin() const -> std::unique_ptr<sles_type::iter_base>
56{
57 return base_->slesBegin();
58}
59
60auto
61ApplyViewBase::slesEnd() const -> std::unique_ptr<sles_type::iter_base>
62{
63 return base_->slesEnd();
64}
65
66auto
68{
69 return base_->slesUpperBound(key);
70}
71
72auto
73ApplyViewBase::txsBegin() const -> std::unique_ptr<txs_type::iter_base>
74{
75 return base_->txsBegin();
76}
77
78auto
79ApplyViewBase::txsEnd() const -> std::unique_ptr<txs_type::iter_base>
80{
81 return base_->txsEnd();
82}
83
84bool
86{
87 return base_->txExists(key);
88}
89
90auto
92{
93 return base_->txRead(key);
94}
95
96//---
97
100{
101 return flags_;
102}
103
106{
107 return items_.peek(*base_, k);
108}
109
110void
115
116void
121
122void
127
128//---
129
130void
135
136void
141
142void
147
148void
153
154} // namespace detail
155} // namespace xrpl
A view into a ledger.
Definition ReadView.h:31
virtual Rules const & rules() const =0
Returns the tx processing rules.
virtual std::unique_ptr< txs_type::iter_base > txsBegin() const =0
virtual Fees const & fees() const =0
Returns the fees for the base ledger.
virtual std::unique_ptr< txs_type::iter_base > txsEnd() const =0
virtual LedgerHeader const & header() const =0
Returns information about the ledger.
virtual bool txExists(key_type const &key) const =0
Returns true if a tx exists in the tx map.
virtual bool open() const =0
Returns true if this reflects an open ledger.
virtual std::unique_ptr< sles_type::iter_base > slesBegin() const =0
virtual std::unique_ptr< sles_type::iter_base > slesEnd() const =0
Rules controlling protocol behavior.
Definition Rules.h:18
void destroyXRP(XRPAmount const &fee)
bool exists(ReadView const &base, Keylet const &k) const
void insert(ReadView const &base, std::shared_ptr< SLE > const &sle)
void erase(ReadView const &base, std::shared_ptr< SLE > const &sle)
std::shared_ptr< SLE > peek(ReadView const &base, Keylet const &k)
void replace(ReadView const &base, std::shared_ptr< SLE > const &sle)
void rawErase(ReadView const &base, std::shared_ptr< SLE > const &sle)
std::shared_ptr< SLE const > read(ReadView const &base, Keylet const &k) const
void update(ReadView const &base, std::shared_ptr< SLE > const &sle)
void rawDestroyXRP(XRPAmount const &feeDrops) override
Destroy XRP.
void rawInsert(std::shared_ptr< SLE > const &sle) override
Unconditionally insert a state item.
void update(std::shared_ptr< SLE > const &sle) override
Indicate changes to a peeked SLE.
ApplyFlags flags() const override
Returns the tx apply flags.
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.
std::unique_ptr< sles_type::iter_base > slesEnd() const override
void erase(std::shared_ptr< SLE > const &sle) override
Remove a peeked SLE.
std::unique_ptr< txs_type::iter_base > txsBegin() const override
bool open() const override
Returns true if this reflects an open ledger.
void rawErase(std::shared_ptr< SLE > const &sle) override
Delete an existing state item.
LedgerHeader const & header() const override
Returns information about the ledger.
std::shared_ptr< SLE > peek(Keylet const &k) override
Prepare to modify the SLE associated with key.
Rules const & rules() const override
Returns the tx processing rules.
detail::ApplyStateTable items_
void rawReplace(std::shared_ptr< SLE > const &sle) override
Unconditionally replace a state item.
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 > slesBegin() const override
std::unique_ptr< sles_type::iter_base > slesUpperBound(uint256 const &key) const override
tx_type txRead(key_type const &key) const override
Read a transaction from the tx map.
Fees const & fees() const override
Returns the fees for the base ledger.
std::unique_ptr< txs_type::iter_base > txsEnd() const override
bool txExists(key_type const &key) const override
Returns true if a tx exists in the tx map.
void insert(std::shared_ptr< SLE > const &sle) override
Insert a new state SLE.
bool exists(Keylet const &k) const override
Determine if a state item exists.
STL namespace.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:5
ApplyFlags
Definition ApplyView.h:10
Reflects the fee settings for a particular ledger.
A pair of SHAMap key and LedgerEntryType.
Definition Keylet.h:19
Information about the notional ledger backing the view.