|
rippled
|
Wraps a DigestAwareReadView to provide caching. More...
#include <CachedView.h>


Public Types | |
| using | base_type = Base |
| using | digest_type = uint256 |
| using | tx_type = std::pair< std::shared_ptr< STTx const >, std::shared_ptr< STObject const > > |
| using | key_type = uint256 |
| using | mapped_type = std::shared_ptr< SLE const > |
Public Member Functions | |
| CachedView ()=delete | |
| CachedView (CachedView const &)=delete | |
| CachedView & | operator= (CachedView const &)=delete |
| CachedView (std::shared_ptr< Base const > const &base, CachedSLEs &cache) | |
| std::shared_ptr< Base const > const & | base () const |
| Returns the base type. More... | |
| bool | exists (Keylet const &k) const override |
| Determine if a state item exists. More... | |
| std::shared_ptr< SLE const > | read (Keylet const &k) const override |
| Return the state item associated with a key. More... | |
| bool | open () const override |
| Returns true if this reflects an open ledger. More... | |
| LedgerInfo const & | info () const override |
| Returns information about the ledger. More... | |
| Fees const & | fees () const override |
| Returns the fees for the base ledger. More... | |
| Rules const & | rules () const override |
| Returns the tx processing rules. More... | |
| 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. More... | |
| std::unique_ptr< sles_type::iter_base > | slesBegin () const override |
| std::unique_ptr< sles_type::iter_base > | slesEnd () const override |
| std::unique_ptr< sles_type::iter_base > | slesUpperBound (uint256 const &key) const override |
| virtual std::unique_ptr< sles_type::iter_base > | slesUpperBound (key_type const &key) const =0 |
| std::unique_ptr< txs_type::iter_base > | txsBegin () const override |
| 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. More... | |
| tx_type | txRead (key_type const &key) const override |
| Read a transaction from the tx map. More... | |
| std::optional< digest_type > | digest (key_type const &key) const override |
| Return the digest associated with the key. More... | |
| NetClock::time_point | parentCloseTime () const |
| Returns the close time of the previous ledger. More... | |
| LedgerIndex | seq () const |
| Returns the sequence number of the base ledger. More... | |
| virtual STAmount | balanceHook (AccountID const &account, AccountID const &issuer, STAmount const &amount) const |
| virtual std::uint32_t | ownerCountHook (AccountID const &account, std::uint32_t count) const |
Public Attributes | |
| sles_type | sles |
| Iterable range of ledger state items. More... | |
| txs_type | txs |
Private Attributes | |
| std::shared_ptr< Base const > | sp_ |
| DigestAwareReadView const & | base_ |
| CachedSLEs & | cache_ |
| std::mutex | mutex_ |
| std::unordered_map< key_type, uint256, hardened_hash<> > | map_ |
Wraps a DigestAwareReadView to provide caching.
| Base | A subclass of DigestAwareReadView |
Definition at line 156 of file CachedView.h.
| using ripple::CachedView< Base >::base_type = Base |
Definition at line 164 of file CachedView.h.
|
inherited |
Definition at line 258 of file ReadView.h.
|
inherited |
Definition at line 54 of file ReadView.h.
|
inherited |
Definition at line 57 of file ReadView.h.
|
inherited |
Definition at line 59 of file ReadView.h.
|
delete |
|
delete |
| ripple::CachedView< Base >::CachedView | ( | std::shared_ptr< Base const > const & | base, |
| CachedSLEs & | cache | ||
| ) |
Definition at line 171 of file CachedView.h.
|
delete |
| std::shared_ptr< Base const > const & ripple::CachedView< Base >::base | ( | ) | const |
Returns the base type.
Definition at line 181 of file CachedView.h.
|
overridevirtualinherited |
Determine if a state item exists.
true if a SLE is associated with the specified key. Implements ripple::ReadView.
Definition at line 28 of file CachedView.cpp.
|
overridevirtualinherited |
Return the state item associated with a key.
Effects: If the key exists, gives the caller ownership of the non-modifiable corresponding SLE.
const from the perspective of the caller, it can be changed by other callers through raw operations.nullptr if the key is not present or if the type does not match. Implements ripple::ReadView.
Definition at line 34 of file CachedView.cpp.
|
overridevirtualinherited |
Returns true if this reflects an open ledger.
Implements ripple::ReadView.
Definition at line 65 of file CachedView.h.
|
overridevirtualinherited |
Returns information about the ledger.
Implements ripple::ReadView.
Definition at line 71 of file CachedView.h.
|
overridevirtualinherited |
Returns the fees for the base ledger.
Implements ripple::ReadView.
Definition at line 77 of file CachedView.h.
|
overridevirtualinherited |
Returns the tx processing rules.
Implements ripple::ReadView.
Definition at line 83 of file CachedView.h.
|
overridevirtualinherited |
Return the key of the next state item.
This returns the key of the first state item whose key is greater than the specified key. If no such key is present, std::nullopt is returned.
If last is engaged, returns std::nullopt when the key returned would be outside the open interval (key, last).
Implements ripple::ReadView.
Definition at line 89 of file CachedView.h.
|
overridevirtualinherited |
Implements ripple::ReadView.
Definition at line 97 of file CachedView.h.
|
overridevirtualinherited |
Implements ripple::ReadView.
Definition at line 103 of file CachedView.h.
|
overrideinherited |
Definition at line 109 of file CachedView.h.
|
pure virtualinherited |
|
overridevirtualinherited |
Implements ripple::ReadView.
Definition at line 115 of file CachedView.h.
|
overridevirtualinherited |
Implements ripple::ReadView.
Definition at line 121 of file CachedView.h.
|
overridevirtualinherited |
Returns true if a tx exists in the tx map.
A tx exists in the map if it is part of the base ledger, or if it is a newly inserted tx.
Implements ripple::ReadView.
Definition at line 127 of file CachedView.h.
|
overridevirtualinherited |
Read a transaction from the tx map.
If the view represents an open ledger, the metadata object will be empty.
Implements ripple::ReadView.
Definition at line 133 of file CachedView.h.
|
overridevirtualinherited |
Return the digest associated with the key.
Implements ripple::DigestAwareReadView.
Definition at line 143 of file CachedView.h.
|
inherited |
Returns the close time of the previous ledger.
Definition at line 112 of file ReadView.h.
|
inherited |
Returns the sequence number of the base ledger.
Definition at line 119 of file ReadView.h.
|
virtualinherited |
Reimplemented in ripple::PaymentSandbox.
Definition at line 179 of file ReadView.h.
|
virtualinherited |
Reimplemented in ripple::PaymentSandbox.
Definition at line 193 of file ReadView.h.
|
private |
Definition at line 161 of file CachedView.h.
|
privateinherited |
Definition at line 38 of file CachedView.h.
|
privateinherited |
Definition at line 39 of file CachedView.h.
|
mutableprivateinherited |
Definition at line 40 of file CachedView.h.
|
mutableprivateinherited |
Definition at line 41 of file CachedView.h.
|
inherited |
Iterable range of ledger state items.
Definition at line 246 of file ReadView.h.
|
inherited |
Definition at line 249 of file ReadView.h.