Kagome
Polkadot Runtime Engine in C++17
|
#include <ephemeral_trie_batch_impl.hpp>
Public Member Functions | |
EphemeralTrieBatchImpl (std::shared_ptr< Codec > codec, std::shared_ptr< PolkadotTrie > trie) | |
~EphemeralTrieBatchImpl () override=default | |
outcome::result< BufferConstRef > | get (const BufferView &key) const override |
Get value by key. More... | |
outcome::result< std::optional< BufferConstRef > > | tryGet (const BufferView &key) const override |
Get value by key. More... | |
std::unique_ptr< PolkadotTrieCursor > | trieCursor () override |
outcome::result< bool > | contains (const BufferView &key) const override |
Checks if given key-value binding exists in the storage. More... | |
bool | empty () const override |
Returns true if the storage is empty. More... | |
outcome::result< std::tuple< bool, uint32_t > > | clearPrefix (const BufferView &prefix, std::optional< uint64_t > limit=std::nullopt) override |
outcome::result< void > | put (const BufferView &key, const Buffer &value) override |
Store value by key. More... | |
outcome::result< void > | put (const BufferView &key, Buffer &&value) override |
outcome::result< void > | remove (const BufferView &key) override |
Remove value by key. More... | |
outcome::result< RootHash > | hash () override |
Public Member Functions inherited from kagome::storage::trie::TrieBatch | |
~TrieBatch () override=default | |
std::unique_ptr< Cursor > | cursor () final |
Returns new key-value iterator. More... | |
Public Member Functions inherited from kagome::storage::face::ReadableMap< BufferView, Buffer > | |
virtual | ~ReadableMap ()=default |
Public Member Functions inherited from kagome::storage::face::ReadableBase< BufferView > | |
virtual | ~ReadableBase ()=default |
Public Member Functions inherited from kagome::storage::face::Writeable< BufferView, Buffer > | |
virtual | ~Writeable ()=default |
Public Member Functions inherited from kagome::storage::face::Iterable< Buffer, common::BufferConstRef, BufferView > | |
virtual | ~Iterable ()=default |
Private Attributes | |
std::shared_ptr< Codec > | codec_ |
std::shared_ptr< PolkadotTrie > | trie_ |
Additional Inherited Members | |
Public Types inherited from kagome::storage::trie::TrieBatch | |
using | Cursor = face::Iterable< Buffer, common::BufferConstRef, BufferView >::Cursor |
Public Types inherited from kagome::storage::face::ReadableMap< BufferView, Buffer > | |
using | Key = BufferView |
using | Value = Buffer |
using | ValueView = std::reference_wrapper< Buffer > |
using | ConstValueView = std::reference_wrapper< const Buffer > |
Public Types inherited from kagome::storage::face::ReadableBase< BufferView > | |
using | Key = BufferView |
Public Types inherited from kagome::storage::face::Iterable< Buffer, common::BufferConstRef, BufferView > | |
using | Cursor = MapCursor< Buffer, common::BufferConstRef, BufferView > |
Definition at line 15 of file ephemeral_trie_batch_impl.hpp.
kagome::storage::trie::EphemeralTrieBatchImpl::EphemeralTrieBatchImpl | ( | std::shared_ptr< Codec > | codec, |
std::shared_ptr< PolkadotTrie > | trie | ||
) |
Definition at line 12 of file ephemeral_trie_batch_impl.cpp.
|
overridedefault |
|
overridevirtual |
Remove all trie entries which key begins with the supplied prefix
Implements kagome::storage::trie::TrieBatch.
Definition at line 43 of file ephemeral_trie_batch_impl.cpp.
|
overridevirtual |
Checks if given key-value binding exists in the storage.
key | K |
Implements kagome::storage::face::ReadableBase< BufferView >.
Definition at line 33 of file ephemeral_trie_batch_impl.cpp.
|
overridevirtual |
Returns true if the storage is empty.
Implements kagome::storage::face::ReadableBase< BufferView >.
Definition at line 38 of file ephemeral_trie_batch_impl.cpp.
|
overridevirtual |
Get value by key.
key | K |
Implements kagome::storage::face::ReadableMap< BufferView, Buffer >.
Definition at line 19 of file ephemeral_trie_batch_impl.cpp.
|
overridevirtual |
Calculates the hash of the state represented by a batch
Implements kagome::storage::trie::EphemeralTrieBatch.
Definition at line 64 of file ephemeral_trie_batch_impl.cpp.
|
overridevirtual |
Store value by key.
key | key |
value | value |
Implements kagome::storage::face::Writeable< BufferView, Buffer >.
Definition at line 50 of file ephemeral_trie_batch_impl.cpp.
|
overridevirtual |
Implements kagome::storage::face::Writeable< BufferView, Buffer >.
Definition at line 55 of file ephemeral_trie_batch_impl.cpp.
|
overridevirtual |
Remove value by key.
key | K |
Implements kagome::storage::face::Writeable< BufferView, Buffer >.
Definition at line 60 of file ephemeral_trie_batch_impl.cpp.
|
overridevirtual |
Implements kagome::storage::trie::TrieBatch.
Definition at line 29 of file ephemeral_trie_batch_impl.cpp.
|
overridevirtual |
Get value by key.
key | K |
Implements kagome::storage::face::ReadableMap< BufferView, Buffer >.
Definition at line 24 of file ephemeral_trie_batch_impl.cpp.
|
private |
Definition at line 37 of file ephemeral_trie_batch_impl.hpp.
|
private |
Definition at line 38 of file ephemeral_trie_batch_impl.hpp.