hyperledger/iroha
Iroha - A simple, decentralized ledger http://iroha.tech
iroha::ametsuchi::KeyValueStorage Class Referenceabstract

#include "key_value_storage.hpp"

Inheritance diagram for iroha::ametsuchi::KeyValueStorage:
Inheritance graph
Collaboration diagram for iroha::ametsuchi::KeyValueStorage:
Collaboration graph

Public Types

using Identifier = uint32_t
 
using Bytes = std::vector< uint8_t >
 

Public Member Functions

virtual bool add (Identifier id, const Bytes &blob)=0
 
virtual boost::optional< Bytesget (Identifier id) const =0
 
virtual std::string directory () const =0
 
virtual Identifier last_id () const =0
 
virtual void dropAll ()=0
 
virtual ~KeyValueStorage ()=default
 

Detailed Description

Solid storage interface

Member Typedef Documentation

using iroha::ametsuchi::KeyValueStorage::Bytes = std::vector<uint8_t>

Type of storage key

Constructor & Destructor Documentation

virtual iroha::ametsuchi::KeyValueStorage::~KeyValueStorage ( )
virtualdefault

Member Function Documentation

virtual bool iroha::ametsuchi::KeyValueStorage::add ( Identifier  id,
const Bytes blob 
)
pure virtual

Add entity with binary data

Parameters
id- reference key
blob- data associated with key

Implemented in iroha::ametsuchi::FlatFile.

virtual std::string iroha::ametsuchi::KeyValueStorage::directory ( ) const
pure virtual
Returns
folder of storage

Implemented in iroha::ametsuchi::FlatFile.

virtual void iroha::ametsuchi::KeyValueStorage::dropAll ( )
pure virtual

Implemented in iroha::ametsuchi::FlatFile.

virtual boost::optional<Bytes> iroha::ametsuchi::KeyValueStorage::get ( Identifier  id) const
pure virtual

Get data associated with

Parameters
id- reference key
Returns
- blob, if exists

Implemented in iroha::ametsuchi::FlatFile.

Here is the caller graph for this function:

virtual Identifier iroha::ametsuchi::KeyValueStorage::last_id ( ) const
pure virtual
Returns
chronologically last not null key

Implemented in iroha::ametsuchi::FlatFile.

Here is the caller graph for this function:


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