1#ifndef XRPL_LEDGER_OPENVIEW_H_INCLUDED
2#define XRPL_LEDGER_OPENVIEW_H_INCLUDED
4#include <xrpl/ledger/RawView.h>
5#include <xrpl/ledger/ReadView.h>
6#include <xrpl/ledger/detail/RawStateTable.h>
7#include <xrpl/protocol/STArray.h>
8#include <xrpl/protocol/XRPAmount.h>
10#include <boost/container/pmr/monotonic_buffer_resource.hpp>
11#include <boost/container/pmr/polymorphic_allocator.hpp>
76 boost::container::pmr::polymorphic_allocator<
195 fees()
const override;
198 rules()
const 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.
OpenView(open_ledger_t, Rules const &rules, std::shared_ptr< ReadView const > const &base)
OpenView(OpenView &&)=default
OpenView(batch_view_t, OpenView &base)
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.
OpenView & operator=(OpenView const &)=delete
std::shared_ptr< void const > hold_
bool open() const override
Returns true if this reflects an open ledger.
std::unique_ptr< sles_type::iter_base > slesBegin() const override
std::unique_ptr< boost::container::pmr::monotonic_buffer_resource > monotonic_resource_
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
OpenView & operator=(OpenView &&)=delete
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.
static constexpr size_t initialBufferSize
std::unique_ptr< txs_type::iter_base > txsBegin() const override
std::unique_ptr< sles_type::iter_base > slesEnd() const override
detail::RawStateTable items_
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 xrpl::batch_view_t batch_view
constexpr struct xrpl::open_ledger_t open_ledger
constexpr auto kilobytes(T value) noexcept
Reflects the fee settings for a particular ledger.
A pair of SHAMap key and LedgerEntryType.
txData(std::shared_ptr< Serializer const > const &txn_, std::shared_ptr< Serializer const > const &meta_)
std::shared_ptr< Serializer const > meta
std::shared_ptr< Serializer const > txn
Batch view construction tag.
constexpr batch_view_t()=default
Open ledger construction tag.
constexpr open_ledger_t()=default