20 #ifndef RIPPLE_LEDGER_READVIEW_H_INCLUDED
21 #define RIPPLE_LEDGER_READVIEW_H_INCLUDED
23 #include <ripple/basics/FeeUnits.h>
24 #include <ripple/basics/IOUAmount.h>
25 #include <ripple/basics/XRPAmount.h>
26 #include <ripple/basics/chrono.h>
27 #include <ripple/beast/hash/uhash.h>
28 #include <ripple/beast/utility/Journal.h>
29 #include <ripple/ledger/detail/ReadViewFwdRange.h>
30 #include <ripple/protocol/Indexes.h>
31 #include <ripple/protocol/Protocol.h>
32 #include <ripple/protocol/Rules.h>
33 #include <ripple/protocol/STAmount.h>
34 #include <ripple/protocol/STLedgerEntry.h>
35 #include <ripple/protocol/STTx.h>
55 explicit Fees() =
default;
357 addRaw(LedgerInfo
const&, Serializer&,
bool includeHash =
false);
364 DigestAwareReadView
const& ledger,
369 #include <ripple/ledger/detail/ReadViewFwdRange.ipp>
virtual LedgerInfo const & info() const =0
Returns information about the ledger.
A pair of SHAMap key and LedgerEntryType.
ReadView & operator=(ReadView &&other)=delete
sles_type(ReadView const &view)
void addRaw(LedgerInfo const &info, Serializer &s, bool includeHash)
virtual Fees const & fees() const =0
Returns the fees for the base ledger.
virtual std::unique_ptr< txs_type::iter_base > txsEnd() const =0
virtual STAmount balanceHook(AccountID const &account, AccountID const &issuer, STAmount const &amount) const
virtual bool txExists(key_type const &key) const =0
Returns true if a tx exists in the tx map.
iterator upper_bound(key_type const &key) const
virtual std::unique_ptr< sles_type::iter_base > slesBegin() const =0
NetClock::time_point parentCloseTime() const
Returns the close time of the previous ledger.
virtual std::unique_ptr< txs_type::iter_base > txsBegin() const =0
NetClock::time_point closeTime
Reflects the fee settings for a particular ledger.
virtual std::unique_ptr< sles_type::iter_base > slesUpperBound(key_type const &key) const =0
DigestAwareReadView()=default
virtual std::unique_ptr< sles_type::iter_base > slesEnd() const =0
ReadView that associates keys with digests.
virtual tx_type txRead(key_type const &key) const =0
Read a transaction from the tx map.
virtual bool exists(Keylet const &k) const =0
Determine if a state item exists.
sles_type sles
Iterable range of ledger state items.
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::shared_ptr< SLE const > read(Keylet const &k) const =0
Return the state item associated with a key.
std::pair< std::shared_ptr< STTx const >, std::shared_ptr< STObject const > > tx_type
bool getCloseAgree(LedgerInfo const &info)
ReadView(ReadView &&other)
Use hash_* containers for keys that do not need a cryptographically secure hashing algorithm.
ReadView(ReadView const &other)
XRPAmount accountReserve(std::size_t ownerCount) const
Returns the account reserve given the owner count, in drops.
LedgerIndex seq() const
Returns the sequence number of the base ledger.
virtual Rules const & rules() const =0
Returns the tx processing rules.
NetClock::duration closeTimeResolution
virtual std::uint32_t ownerCountHook(AccountID const &account, std::uint32_t count) const
Rules makeRulesGivenLedger(DigestAwareReadView const &ledger, Rules const ¤t)
Rules controlling protocol behavior.
Fees & operator=(Fees const &)=default
virtual ~ReadView()=default
Information about the notional ledger backing the view.
virtual std::optional< digest_type > digest(key_type const &key) const =0
Return the digest associated with the key.
virtual bool open() const =0
Returns true if this reflects an open ledger.
static const std::uint32_t sLCF_NoConsensusTime
NetClock::time_point parentCloseTime
txs_type(ReadView const &view)