20 #include <ripple/ledger/OpenView.h>
21 #include <ripple/basics/contract.h>
28 :
public txs_type::iter_base
37 txs_map::const_iterator iter)
52 equal (base_type
const& impl)
const override
54 auto const& other =
dynamic_cast<
56 return iter_ == other.iter_;
71 iter_->second.first->slice());
78 iter_->second.second->slice());
92 , info_ (base->info())
94 , hold_ (
std::move(hold))
105 : rules_ (base->rules())
106 , info_ (base->info())
108 , hold_ (
std::move(hold))
109 , open_ (base->
open())
123 for (
auto const& item :
txs_)
157 boost::optional<key_type>
const& last)
const ->
158 boost::optional<key_type>
160 return items_.succ(*base_, key, last);
187 return items_.slesUpperBound(*base_, key);
194 return std::make_unique<txs_iter_impl>(
202 return std::make_unique<txs_iter_impl>(
216 auto const iter = txs_.find(key);
217 if (iter == txs_.end())
218 return base_->txRead(key);
219 auto const& item = iter->
second;
222 decltype(tx_type::second) sto;
224 sto = std::make_shared<STObject const>(
229 return { std::move(stx), std::move(sto) };
virtual LedgerInfo const & info() const =0
Returns information about the ledger.
std::size_t txCount() const
Return the number of tx inserted since creation.
A pair of SHAMap key and LedgerEntryType.
bool equal(base_type const &impl) const override
LedgerInfo const & info() const override
Returns information about the ledger.
const open_ledger_t open_ledger
void apply(TxsRawView &to) const
Apply changes.
const SField sfMetadata(access, STI_METADATA, 257, "Metadata")
void rawErase(std::shared_ptr< SLE > const &sle) override
Delete an existing state item.
virtual Fees const & fees() const =0
Returns the fees for the base ledger.
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::shared_ptr< SLE const > read(ReadView const &base, Keylet const &k) const
std::string to_string(ListDisposition disposition)
detail::RawStateTable items_
NetClock::time_point closeTime
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.
virtual void rawTxInsert(ReadView::key_type const &key, std::shared_ptr< Serializer const > const &txn, std::shared_ptr< Serializer const > const &metaData)=0
Add a transaction to the tx map.
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::unique_ptr< base_type > copy() const override
void increment() override
std::unique_ptr< ReadView::sles_type::iter_base > slesBegin(ReadView const &base) const
void erase(std::shared_ptr< SLE > const &sle)
bool exists(ReadView const &base, Keylet const &k) const
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.
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 apply(RawView &to) const
std::unique_ptr< txs_type::iter_base > txsBegin() const override
void destroyXRP(XRPAmount const &fee)
void LogicError(std::string const &how) noexcept
Called when faulty logic causes a broken invariant.
void insert(std::shared_ptr< SLE > const &sle)
txs_iter_impl(bool metadata, txs_map::const_iterator iter)
value_type dereference() 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.
void replace(std::shared_ptr< SLE > const &sle)
std::unique_ptr< sles_type::iter_base > slesEnd() const override
Information about the notional ledger backing the view.
Interface for changing ledger entries with transactions.
std::unique_ptr< ReadView::sles_type::iter_base > slesEnd(ReadView const &base) const
std::unique_ptr< sles_type::iter_base > slesBegin() const override
txs_map::const_iterator iter_
Rules const & rules() const override
Returns the tx processing rules.
void open(soci::session &s, BasicConfig const &config, std::string const &dbName)
Open a soci session.
boost::optional< key_type > succ(key_type const &key, boost::optional< key_type > const &last=boost::none) const override
Return the key of the next state item.
NetClock::time_point parentCloseTime