Kagome
Polkadot Runtime Engine in C++17
kagome::storage::trie::EphemeralTrieBatch Class Referenceabstract

#include <trie_batches.hpp>

Inheritance diagram for kagome::storage::trie::EphemeralTrieBatch:
Collaboration diagram for kagome::storage::trie::EphemeralTrieBatch:

Public Member Functions

virtual outcome::result< RootHashhash ()=0
 
- Public Member Functions inherited from kagome::storage::trie::TrieBatch
 ~TrieBatch () override=default
 
std::unique_ptr< Cursorcursor () final
 Returns new key-value iterator. More...
 
virtual std::unique_ptr< PolkadotTrieCursortrieCursor ()=0
 
virtual outcome::result< std::tuple< bool, uint32_t > > clearPrefix (const BufferView &prefix, std::optional< uint64_t > limit=std::nullopt)=0
 
- Public Member Functions inherited from kagome::storage::face::ReadableMap< BufferView, Buffer >
virtual ~ReadableMap ()=default
 
virtual outcome::result< ConstValueViewget (const Key &key) const =0
 Get value by key. More...
 
virtual outcome::result< std::optional< ConstValueView > > tryGet (const Key &key) const =0
 Get value by key. More...
 
- Public Member Functions inherited from kagome::storage::face::ReadableBase< BufferView >
virtual ~ReadableBase ()=default
 
virtual outcome::result< bool > contains (const Key &key) const =0
 Checks if given key-value binding exists in the storage. More...
 
virtual bool empty () const =0
 Returns true if the storage is empty. More...
 
- Public Member Functions inherited from kagome::storage::face::Writeable< BufferView, Buffer >
virtual ~Writeable ()=default
 
virtual outcome::result< void > put (const BufferView &key, const Buffer &value)=0
 Store value by key. More...
 
virtual outcome::result< void > put (const BufferView &key, Buffer &&value)=0
 
virtual outcome::result< void > remove (const BufferView &key)=0
 Remove value by key. More...
 
- Public Member Functions inherited from kagome::storage::face::Iterable< Buffer, common::BufferConstRef, BufferView >
virtual ~Iterable ()=default
 

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 >
 

Detailed Description

A temporary in-memory trie built on top of a persistent one All changes to it are simply discarded when the batch is destroyed

Definition at line 64 of file trie_batches.hpp.

Member Function Documentation

virtual outcome::result<RootHash> kagome::storage::trie::EphemeralTrieBatch::hash ( )
pure virtual

Calculates the hash of the state represented by a batch

Implemented in kagome::storage::trie::EphemeralTrieBatchImpl.


The documentation for this class was generated from the following file: