20#ifndef RIPPLE_LEDGER_CACHEDVIEW_H_INCLUDED
21#define RIPPLE_LEDGER_CACHEDVIEW_H_INCLUDED
23#include <xrpl/basics/hardened_hash.h>
24#include <xrpl/ledger/CachedSLEs.h>
25#include <xrpl/ledger/ReadView.h>
Wraps a DigestAwareReadView to provide caching.
std::shared_ptr< Base const > const & base() const
Returns the base type.
std::shared_ptr< Base const > sp_
CachedView(std::shared_ptr< Base const > const &base, CachedSLEs &cache)
CachedView & operator=(CachedView const &)=delete
CachedView(CachedView const &)=delete
ReadView that associates keys with digests.
virtual std::optional< digest_type > digest(key_type const &key) const =0
Return the digest associated with the key.
virtual std::optional< key_type > succ(key_type const &key, std::optional< key_type > const &last=std::nullopt) const =0
Return the key of the next state item.
virtual std::unique_ptr< sles_type::iter_base > slesUpperBound(key_type const &key) const =0
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.
std::pair< std::shared_ptr< STTx const >, std::shared_ptr< STObject const > > tx_type
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 tx_type txRead(key_type const &key) const =0
Read a transaction from the tx map.
virtual bool txExists(key_type const &key) const =0
Returns true if a tx exists in the tx map.
Rules controlling protocol behavior.
std::unique_ptr< txs_type::iter_base > txsEnd() const override
tx_type txRead(key_type const &key) const override
Read a transaction from the tx map.
CachedViewImpl & operator=(CachedViewImpl const &)=delete
std::optional< digest_type > digest(key_type const &key) const override
Return the digest associated with the key.
DigestAwareReadView const & base_
std::unique_ptr< sles_type::iter_base > slesUpperBound(uint256 const &key) const override
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.
LedgerInfo const & info() const override
Returns information about the ledger.
bool exists(Keylet const &k) const override
Determine if a state item exists.
std::unique_ptr< txs_type::iter_base > txsBegin() const override
CachedViewImpl(CachedViewImpl const &)=delete
std::unordered_map< key_type, uint256, hardened_hash<> > map_
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 > slesBegin() const override
std::unique_ptr< sles_type::iter_base > slesEnd() const override
CachedViewImpl(DigestAwareReadView const *base, CachedSLEs &cache)
Rules const & rules() const override
Returns the tx processing rules.
Fees const & fees() const override
Returns the fees for the base ledger.
bool open() const override
Returns true if this reflects an open ledger.
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
T get(Section const §ion, std::string const &name, T const &defaultValue=T{})
Retrieve a key/value pair from a section.
Reflects the fee settings for a particular ledger.
A pair of SHAMap key and LedgerEntryType.