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

#include <trie_batches.hpp>

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

Public Types

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 >
 

Public Member Functions

 ~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
 

Detailed Description

Definition at line 15 of file trie_batches.hpp.

Member Typedef Documentation

Constructor & Destructor Documentation

kagome::storage::trie::TrieBatch::~TrieBatch ( )
overridedefault

Member Function Documentation

virtual outcome::result<std::tuple<bool, uint32_t> > kagome::storage::trie::TrieBatch::clearPrefix ( const BufferView prefix,
std::optional< uint64_t >  limit = std::nullopt 
)
pure virtual

Remove all trie entries which key begins with the supplied prefix

Implemented in kagome::storage::trie::TopperTrieBatchImpl, kagome::storage::trie::PersistentTrieBatchImpl, and kagome::storage::trie::EphemeralTrieBatchImpl.

std::unique_ptr<Cursor> kagome::storage::trie::TrieBatch::cursor ( )
inlinefinalvirtual

Returns new key-value iterator.

Returns
kv iterator

Implements kagome::storage::face::Iterable< Buffer, common::BufferConstRef, BufferView >.

Definition at line 24 of file trie_batches.hpp.

virtual std::unique_ptr<PolkadotTrieCursor> kagome::storage::trie::TrieBatch::trieCursor ( )
pure virtual

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