rippled
Loading...
Searching...
No Matches
ApplyViewBase.cpp
1#include <xrpl/ledger/detail/ApplyViewBase.h>
2
3namespace ripple {
4namespace detail {
5
7 : flags_(flags), base_(base)
8{
9}
10
11//---
12
13bool
15{
16 return base_->open();
17}
18
19LedgerInfo const&
21{
22 return base_->info();
23}
24
25Fees const&
27{
28 return base_->fees();
29}
30
31Rules const&
33{
34 return base_->rules();
35}
36
37bool
39{
40 return items_.exists(*base_, k);
41}
42
43auto
46{
47 return items_.succ(*base_, key, last);
48}
49
52{
53 return items_.read(*base_, k);
54}
55
56auto
57ApplyViewBase::slesBegin() const -> std::unique_ptr<sles_type::iter_base>
58{
59 return base_->slesBegin();
60}
61
62auto
63ApplyViewBase::slesEnd() const -> std::unique_ptr<sles_type::iter_base>
64{
65 return base_->slesEnd();
66}
67
68auto
71{
72 return base_->slesUpperBound(key);
73}
74
75auto
76ApplyViewBase::txsBegin() const -> std::unique_ptr<txs_type::iter_base>
77{
78 return base_->txsBegin();
79}
80
81auto
82ApplyViewBase::txsEnd() const -> std::unique_ptr<txs_type::iter_base>
83{
84 return base_->txsEnd();
85}
86
87bool
89{
90 return base_->txExists(key);
91}
92
93auto
95{
96 return base_->txRead(key);
97}
98
99//---
100
103{
104 return flags_;
105}
106
109{
110 return items_.peek(*base_, k);
111}
112
113void
118
119void
124
125void
130
131//---
132
133void
138
139void
144
145void
150
151void
156
157} // namespace detail
158} // namespace ripple
A view into a ledger.
Definition ReadView.h:32
virtual std::unique_ptr< txs_type::iter_base > txsBegin() const =0
virtual std::unique_ptr< sles_type::iter_base > slesEnd() const =0
virtual bool open() const =0
Returns true if this reflects an open ledger.
virtual Fees const & fees() const =0
Returns the fees for the base ledger.
virtual LedgerInfo const & info() const =0
Returns information about the ledger.
virtual Rules const & rules() const =0
Returns the tx processing rules.
virtual std::unique_ptr< txs_type::iter_base > txsEnd() const =0
virtual std::unique_ptr< sles_type::iter_base > slesBegin() const =0
virtual bool txExists(key_type const &key) const =0
Returns true if a tx exists in the tx map.
Rules controlling protocol behavior.
Definition Rules.h:19
std::shared_ptr< SLE > peek(ReadView const &base, Keylet const &k)
void erase(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)
bool exists(ReadView const &base, Keylet const &k) const
void insert(ReadView const &base, std::shared_ptr< SLE > const &sle)
void replace(ReadView const &base, std::shared_ptr< SLE > const &sle)
void destroyXRP(XRPAmount const &fee)
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.
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.
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.
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.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
Definition algorithm.h:6
STL namespace.
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.