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

#include <trie_batches.hpp>

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

Public Member Functions

virtual outcome::result< RootHashcommit ()=0
 
virtual std::unique_ptr< TopperTrieBatchbatchOnTop ()=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 batch that grants access to the persistent trie storage. All changes are contained in memory until commit() is called.

Definition at line 44 of file trie_batches.hpp.

Member Function Documentation

virtual std::unique_ptr<TopperTrieBatch> kagome::storage::trie::PersistentTrieBatch::batchOnTop ( )
pure virtual

Creates a batch on top of this batch

Implemented in kagome::storage::trie::PersistentTrieBatchImpl.

virtual outcome::result<RootHash> kagome::storage::trie::PersistentTrieBatch::commit ( )
pure virtual

Commits changes to a persistent storage

Returns
the root of the committed trie

Implemented in kagome::storage::trie::PersistentTrieBatchImpl.


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