20#ifndef RIPPLE_LEDGER_OPENVIEW_H_INCLUDED
21#define RIPPLE_LEDGER_OPENVIEW_H_INCLUDED
23#include <xrpl/ledger/RawView.h>
24#include <xrpl/ledger/ReadView.h>
25#include <xrpl/ledger/detail/RawStateTable.h>
26#include <xrpl/protocol/STArray.h>
27#include <xrpl/protocol/XRPAmount.h>
29#include <boost/container/pmr/monotonic_buffer_resource.hpp>
30#include <boost/container/pmr/polymorphic_allocator.hpp>
95 boost::container::pmr::polymorphic_allocator<
211 info()
const override;
214 fees()
const override;
217 rules()
const override;
Writable ledger view that accumulates state and tx changes.
std::size_t txCount() const
Return the number of tx inserted since creation.
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.
bool txExists(key_type const &key) const override
Returns true if a tx exists in the tx map.
OpenView & operator=(OpenView &&)=delete
LedgerInfo const & info() const override
Returns information about the ledger.
std::unique_ptr< boost::container::pmr::monotonic_buffer_resource > monotonic_resource_
std::unique_ptr< sles_type::iter_base > slesEnd() const override
static constexpr size_t initialBufferSize
OpenView(open_ledger_t, Rules const &rules, std::shared_ptr< ReadView const > const &base)
detail::RawStateTable items_
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.
void rawDestroyXRP(XRPAmount const &fee) override
Destroy XRP.
bool exists(Keylet const &k) const override
Determine if a state item exists.
OpenView & operator=(OpenView const &)=delete
Rules const & rules() const override
Returns the tx processing rules.
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
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.
void rawErase(std::shared_ptr< SLE > const &sle) override
Delete an existing state item.
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.
void rawInsert(std::shared_ptr< SLE > const &sle) override
Unconditionally insert a state item.
bool open() const override
Returns true if this reflects an open ledger.
std::shared_ptr< void const > hold_
OpenView(batch_view_t, OpenView &base)
OpenView(OpenView &&)=default
std::unique_ptr< txs_type::iter_base > txsBegin() const override
Fees const & fees() const override
Returns the fees for the base ledger.
void apply(TxsRawView &to) const
Apply changes.
std::unique_ptr< txs_type::iter_base > txsEnd() const override
std::pair< std::shared_ptr< STTx const >, std::shared_ptr< STObject const > > tx_type
Rules controlling protocol behavior.
Interface for changing ledger entries with transactions.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
constexpr struct ripple::open_ledger_t open_ledger
constexpr struct ripple::batch_view_t batch_view
constexpr auto kilobytes(T value) noexcept
Reflects the fee settings for a particular ledger.
A pair of SHAMap key and LedgerEntryType.
std::shared_ptr< Serializer const > txn
std::shared_ptr< Serializer const > meta
txData(std::shared_ptr< Serializer const > const &txn_, std::shared_ptr< Serializer const > const &meta_)
Batch view construction tag.
constexpr batch_view_t()=default
Open ledger construction tag.
constexpr open_ledger_t()=default