Kagome
Polkadot Runtime Engine in C++17
kagome::storage::RocksDB::Batch Class Reference

#include <rocksdb_batch.hpp>

Inheritance diagram for kagome::storage::RocksDB::Batch:
Collaboration diagram for kagome::storage::RocksDB::Batch:

Public Member Functions

 ~Batch () override=default
 
 Batch (RocksDB &db)
 
outcome::result< void > commit () override
 Writes batch. More...
 
void clear () override
 Clear batch. More...
 
outcome::result< void > put (const BufferView &key, const Buffer &value) override
 
outcome::result< void > put (const BufferView &key, Buffer &&value) override
 
outcome::result< void > remove (const BufferView &key) override
 
- Public Member Functions inherited from kagome::storage::face::Writeable< K, V >
virtual ~Writeable ()=default
 
virtual outcome::result< void > put (const K &key, const V &value)=0
 Store value by key. More...
 
virtual outcome::result< void > put (const K &key, V &&value)=0
 
virtual outcome::result< void > remove (const K &key)=0
 Remove value by key. More...
 

Private Attributes

RocksDBdb_
 
rocksdb::WriteBatch batch_
 

Detailed Description

Definition at line 14 of file rocksdb_batch.hpp.

Constructor & Destructor Documentation

kagome::storage::RocksDB::Batch::~Batch ( )
overridedefault
kagome::storage::RocksDB::Batch::Batch ( RocksDB db)
explicit

Definition at line 13 of file rocksdb_batch.cpp.

Member Function Documentation

void kagome::storage::RocksDB::Batch::clear ( )
overridevirtual

Clear batch.

Implements kagome::storage::face::WriteBatch< K, V >.

Definition at line 40 of file rocksdb_batch.cpp.

outcome::result< void > kagome::storage::RocksDB::Batch::commit ( )
overridevirtual

Writes batch.

Returns
error code in case of error.

Implements kagome::storage::face::WriteBatch< K, V >.

Definition at line 31 of file rocksdb_batch.cpp.

outcome::result< void > kagome::storage::RocksDB::Batch::put ( const BufferView key,
const Buffer value 
)
override

Definition at line 15 of file rocksdb_batch.cpp.

outcome::result< void > kagome::storage::RocksDB::Batch::put ( const BufferView key,
Buffer &&  value 
)
override

Definition at line 21 of file rocksdb_batch.cpp.

outcome::result< void > kagome::storage::RocksDB::Batch::remove ( const BufferView key)
override

Definition at line 26 of file rocksdb_batch.cpp.

Member Data Documentation

rocksdb::WriteBatch kagome::storage::RocksDB::Batch::batch_
private

Definition at line 33 of file rocksdb_batch.hpp.

RocksDB& kagome::storage::RocksDB::Batch::db_
private

Definition at line 32 of file rocksdb_batch.hpp.


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