1#include <xrpl/basics/contract.h>
2#include <xrpl/ledger/OpenView.h>
24 equal(base_type
const& impl)
const override
27 return iter_ == p->iter_;
59 , monotonic_resource_{
std::make_unique<
boost::container::pmr::monotonic_buffer_resource>(initialBufferSize)}
60 , txs_{rhs.txs_, monotonic_resource_.
get()}
62 , header_{rhs.header_}
66 , open_{rhs.open_} {};
69 : monotonic_resource_{
std::make_unique<
boost::container::pmr::monotonic_buffer_resource>(initialBufferSize)}
70 , txs_{monotonic_resource_.
get()}
72 , header_(base->header())
74 , hold_(
std::move(hold))
84 : monotonic_resource_{
std::make_unique<
boost::container::pmr::monotonic_buffer_resource>(initialBufferSize)}
85 , txs_{monotonic_resource_.
get()}
86 , rules_(base->rules())
87 , header_(base->header())
89 , hold_(
std::move(hold))
104 for (
auto const& item :
txs_)
105 to.
rawTxInsert(item.first, item.second.txn, item.second.meta);
137 return items_.succ(*base_, key, last);
161 return items_.slesUpperBound(*base_, key);
185 auto const iter = txs_.find(key);
186 if (iter == txs_.end())
187 return base_->txRead(key);
188 auto const& item = iter->
second;
190 decltype(tx_type::second) sto;
195 return {std::move(stx), std::move(sto)};
std::unique_ptr< base_type > copy() const override
txs_map::const_iterator iter_
value_type dereference() const override
txs_iter_impl(bool metadata, txs_map::const_iterator iter)
bool equal(base_type const &impl) const override
void increment() override
Writable ledger view that accumulates state and tx changes.
void rawErase(std::shared_ptr< SLE > const &sle) override
Delete an existing state item.
void rawDestroyXRP(XRPAmount const &fee) override
Destroy XRP.
std::size_t txCount() const
Return the number of tx inserted since creation.
tx_type txRead(key_type const &key) const override
Read a transaction from the tx map.
void rawInsert(std::shared_ptr< SLE > const &sle) override
Unconditionally insert a state item.
Fees const & fees() const override
Returns the fees for the base ledger.
std::unique_ptr< txs_type::iter_base > txsEnd() const override
std::size_t baseTxCount_
In batch mode, the number of transactions already executed.
void rawReplace(std::shared_ptr< SLE > const &sle) override
Unconditionally replace a state item.
bool txExists(key_type const &key) const override
Returns true if a tx exists in the tx map.
bool open() const override
Returns true if this reflects an open ledger.
std::unique_ptr< sles_type::iter_base > slesBegin() const override
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 > slesUpperBound(uint256 const &key) const override
void rawTxInsert(key_type const &key, std::shared_ptr< Serializer const > const &txn, std::shared_ptr< Serializer const > const &metaData) override
Add a transaction to the tx map.
std::shared_ptr< SLE const > read(Keylet const &k) const override
Return the state item associated with a key.
LedgerHeader const & header() const override
Returns information about the ledger.
void apply(TxsRawView &to) const
Apply changes.
Rules const & rules() const override
Returns the tx processing rules.
bool exists(Keylet const &k) const override
Determine if a state item exists.
std::unique_ptr< txs_type::iter_base > txsBegin() const override
std::unique_ptr< sles_type::iter_base > slesEnd() const override
detail::RawStateTable items_
virtual Fees const & fees() const =0
Returns the fees for the base ledger.
virtual LedgerHeader const & header() const =0
Returns information about the ledger.
Rules controlling protocol behavior.
Interface for changing ledger entries with transactions.
virtual void rawTxInsert(ReadView::key_type const &key, std::shared_ptr< Serializer const > const &txn, std::shared_ptr< Serializer const > const &metaData)=0
Add a transaction to the tx map.
std::shared_ptr< SLE const > read(ReadView const &base, Keylet const &k) const
bool exists(ReadView const &base, Keylet const &k) const
std::unique_ptr< ReadView::sles_type::iter_base > slesBegin(ReadView const &base) const
void erase(std::shared_ptr< SLE > const &sle)
void apply(RawView &to) const
void replace(std::shared_ptr< SLE > const &sle)
void destroyXRP(XRPAmount const &fee)
void insert(std::shared_ptr< SLE > const &sle)
std::unique_ptr< ReadView::sles_type::iter_base > slesEnd(ReadView const &base) const
T forward_as_tuple(T... args)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
void LogicError(std::string const &how) noexcept
Called when faulty logic causes a broken invariant.
std::string to_string(base_uint< Bits, Tag > const &a)
T get(Section const §ion, std::string const &name, T const &defaultValue=T{})
Retrieve a key/value pair from a section.
@ open
We haven't closed our ledger yet, but others might have.
Reflects the fee settings for a particular ledger.
A pair of SHAMap key and LedgerEntryType.
Open ledger construction tag.