Skip to content

sgns::storage::face::WriteBatch

An abstraction over a storage, which can be used for batch writes. More...

#include <write_batch.hpp>

Inherits from sgns::storage::face::Writeable< K, V >

Public Functions

Name
virtual outcome::result< void > commit() =0
Writes batch.
virtual void clear() =0
Clear batch.

Additional inherited members

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

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.

Detailed Description

template <typename K ,
typename V >
struct sgns::storage::face::WriteBatch;

An abstraction over a storage, which can be used for batch writes.

Template Parameters:

  • K key type
  • V value type

Public Functions Documentation

function commit

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

Writes batch.

Return: error code in case of error.

Reimplemented by: sgns::storage::InMemoryBatch::commit, sgns::storage::rocksdb::Batch::commit, sgns::storage::trie::TrieStorageBackendBatch::commit

function clear

virtual void clear() =0

Clear batch.

Reimplemented by: sgns::storage::InMemoryBatch::clear, sgns::storage::rocksdb::Batch::clear, sgns::storage::trie::TrieStorageBackendBatch::clear


Updated on 2026-03-04 at 13:10:44 -0800