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