Skip to content

sgns::storage::trie::PersistentTrieBatch

More...

#include <trie_batches.hpp>

Inherits from sgns::storage::trie::TrieBatch, std::enable_shared_from_this< PersistentTrieBatch >, sgns::storage::face::Readable< Buffer, Buffer >, sgns::storage::face::Writeable< Buffer, Buffer >, sgns::storage::face::Iterable< Buffer, Buffer >

Inherited by sgns::storage::trie::PersistentTrieBatchImpl

Public Functions

Name
virtual outcome::result< Buffer > commit() =0
virtual std::unique_ptr< TopperTrieBatch > batchOnTop() =0

Additional inherited members

Public Functions inherited from sgns::storage::trie::TrieBatch

Name
~TrieBatch() override =default
virtual outcome::result< void > clearPrefix(const Buffer & prefix) =0

Public Functions inherited from sgns::storage::face::Readable< Buffer, Buffer >

Name
virtual ~Readable() =default
virtual outcome::result< V > get(const K & key) const =0
Get value by key.
virtual bool contains(const K & key) const =0
Returns true if given key-value binding exists in the storage.
virtual bool empty() const =0
Returns true if the storage is empty.

Public Functions inherited from sgns::storage::face::Writeable< Buffer, Buffer >

Name
virtual ~Writeable() =default
virtual outcome::result< void > put(const K & key, const V & value) =0
Store value by key.
virtual outcome::result< void > put(const K & key, V && value) =0
virtual outcome::result< void > remove(const K & key) =0
Remove value by key.

Public Functions inherited from sgns::storage::face::Iterable< Buffer, Buffer >

Name
virtual ~Iterable() =default
virtual std::unique_ptr< MapCursor< K, V > > cursor() =0
Returns new key-value iterator.

Detailed Description

class sgns::storage::trie::PersistentTrieBatch;

A batch that grants access to the persistent trie storage. All changes are contained in memory until commit() is called.

Public Functions Documentation

function commit

virtual outcome::result< Buffer > commit() =0

Return: the root of the committed trie

Reimplemented by: sgns::storage::trie::PersistentTrieBatchImpl::commit

Commits changes to a persistent storage

function batchOnTop

virtual std::unique_ptr< TopperTrieBatch > batchOnTop() =0

Reimplemented by: sgns::storage::trie::PersistentTrieBatchImpl::batchOnTop

Creates a batch on top of this batch


Updated on 2026-04-15 at 11:00:39 -0700