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

#include <in_memory_batch.hpp>

Inheritance diagram for kagome::storage::InMemoryBatch:
Collaboration diagram for kagome::storage::InMemoryBatch:

Public Member Functions

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

Private Attributes

std::map< std::string, Bufferentries
 
InMemoryStoragedb
 

Detailed Description

Definition at line 15 of file in_memory_batch.hpp.

Constructor & Destructor Documentation

kagome::storage::InMemoryBatch::InMemoryBatch ( InMemoryStorage db)
inlineexplicit

Definition at line 18 of file in_memory_batch.hpp.

Member Function Documentation

void kagome::storage::InMemoryBatch::clear ( )
inlineoverridevirtual

Clear batch.

Implements kagome::storage::face::WriteBatch< BufferView, Buffer >.

Definition at line 43 of file in_memory_batch.hpp.

outcome::result<void> kagome::storage::InMemoryBatch::commit ( )
inlineoverridevirtual

Writes batch.

Returns
error code in case of error.

Implements kagome::storage::face::WriteBatch< BufferView, Buffer >.

Definition at line 36 of file in_memory_batch.hpp.

outcome::result<void> kagome::storage::InMemoryBatch::put ( const BufferView key,
const Buffer value 
)
inlineoverridevirtual

Store value by key.

Parameters
keykey
valuevalue
Returns
result containing void if put successful, error otherwise

Implements kagome::storage::face::Writeable< BufferView, Buffer >.

Definition at line 20 of file in_memory_batch.hpp.

outcome::result<void> kagome::storage::InMemoryBatch::put ( const BufferView key,
Buffer &&  value 
)
inlineoverridevirtual
outcome::result<void> kagome::storage::InMemoryBatch::remove ( const BufferView key)
inlineoverridevirtual

Remove value by key.

Parameters
keyK
Returns
error code if error happened

Implements kagome::storage::face::Writeable< BufferView, Buffer >.

Definition at line 31 of file in_memory_batch.hpp.

Member Data Documentation

InMemoryStorage& kagome::storage::InMemoryBatch::db
private

Definition at line 49 of file in_memory_batch.hpp.

std::map<std::string, Buffer> kagome::storage::InMemoryBatch::entries
private

Definition at line 48 of file in_memory_batch.hpp.


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