20 #include <ripple/basics/contract.h>
21 #include <ripple/ledger/OpenView.h>
46 equal(base_type
const& impl)
const override
49 return iter_ == other.iter_;
64 result.first = std::make_shared<STTx const>(sit);
69 result.second = std::make_shared<STObject const>(sit,
sfMetadata);
82 : rules_(rules), info_(base->info()), base_(base), hold_(
std::move(hold))
92 : rules_(base->rules())
95 , hold_(
std::move(hold))
110 for (
auto const& item :
txs_)
111 to.
rawTxInsert(item.first, item.second.first, item.second.second);
142 -> boost::optional<key_type>
144 return items_.succ(*base_, key, last);
169 return items_.slesUpperBound(*base_, key);
181 return std::make_unique<txs_iter_impl>(!
open(),
txs_.
cend());
193 auto const iter = txs_.find(key);
194 if (iter == txs_.end())
195 return base_->txRead(key);
196 auto const& item = iter->
second;
197 auto stx = std::make_shared<STTx const>(
SerialIter{item.first->slice()});
198 decltype(tx_type::second) sto;
200 sto = std::make_shared<STObject const>(
204 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